diff --git a/src/AD.FsCheck.MSTest.FsTests/AD.FsCheck.MSTest.FsTests.fsproj b/src/AD.FsCheck.MSTest.FsTests/AD.FsCheck.MSTest.FsTests.fsproj
index 437a85c..b967ac8 100644
--- a/src/AD.FsCheck.MSTest.FsTests/AD.FsCheck.MSTest.FsTests.fsproj
+++ b/src/AD.FsCheck.MSTest.FsTests/AD.FsCheck.MSTest.FsTests.fsproj
@@ -13,8 +13,8 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/AD.FsCheck.MSTest.FsTests/VectorTest.fs b/src/AD.FsCheck.MSTest.FsTests/VectorTest.fs
index 3952b0d..3ffeb4d 100644
--- a/src/AD.FsCheck.MSTest.FsTests/VectorTest.fs
+++ b/src/AD.FsCheck.MSTest.FsTests/VectorTest.fs
@@ -12,7 +12,7 @@ with static member (+) (a, b) = { X = a.X + b.X; Y = a.Y + b.Y }
module Vector =
let plusIdentity = { X = 0; Y = 0}
-[]
+[]
type VectorTest () =
[]
@@ -39,7 +39,7 @@ type VectorSerializationTest () =
return vector
}
- []
+ []
member _.```Serialize and deserialize`` expected : Task = task {
let! data = expected |> serialize
let! actual = data |> deserialize
diff --git a/src/AD.FsCheck.MSTest.Tests.Arbitraries/AD.FsCheck.MSTest.Tests.Arbitraries.csproj b/src/AD.FsCheck.MSTest.Tests.Arbitraries/AD.FsCheck.MSTest.Tests.Arbitraries.csproj
index b1bd4ca..d7f0490 100644
--- a/src/AD.FsCheck.MSTest.Tests.Arbitraries/AD.FsCheck.MSTest.Tests.Arbitraries.csproj
+++ b/src/AD.FsCheck.MSTest.Tests.Arbitraries/AD.FsCheck.MSTest.Tests.Arbitraries.csproj
@@ -1,4 +1,4 @@
-
+
false
@@ -11,8 +11,8 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
diff --git a/src/AD.FsCheck.MSTest.Tests.Arbitraries/Arbitraries.cs b/src/AD.FsCheck.MSTest.Tests.Arbitraries/Arbitraries.cs
index fba3394..89df08c 100644
--- a/src/AD.FsCheck.MSTest.Tests.Arbitraries/Arbitraries.cs
+++ b/src/AD.FsCheck.MSTest.Tests.Arbitraries/Arbitraries.cs
@@ -1,15 +1,8 @@
namespace AD.FsCheck.MSTest.Tests.Arbitraries;
-[TestClass]
-public sealed class Arbitraries
+public static class Arbitraries
{
- public static Arbitrary From100To200Arbitrary() => Arb.From(
+ public static Arbitrary From100To200(Arbitrary intArb) => Arb.From(
Gen.Choose(100, 200).Select(value => new From100To200(value)),
- from100To200 => Arb.Shrink(from100To200.Value).Where(value => value >= 100 && value <= 200).Select(value => new From100To200(value)));
-
- [AssemblyInitialize]
- public static void Initialize(TestContext _)
- {
- Arb.Register();
- }
-}
\ No newline at end of file
+ from100To200 => intArb.Shrinker(from100To200.Value).Where(value => value >= 100 && value <= 200).Select(value => new From100To200(value)));
+}
diff --git a/src/AD.FsCheck.MSTest.Tests.Arbitraries/From100To200Tests.cs b/src/AD.FsCheck.MSTest.Tests.Arbitraries/From100To200Tests.cs
index 6bff8c8..5eb4a31 100644
--- a/src/AD.FsCheck.MSTest.Tests.Arbitraries/From100To200Tests.cs
+++ b/src/AD.FsCheck.MSTest.Tests.Arbitraries/From100To200Tests.cs
@@ -3,7 +3,7 @@
[TestClass]
public sealed class From100To200Tests
{
- [Property]
+ [Property(Arbitrary = [typeof(Arbitraries)])]
public void IsInRange(From100To200 x)
{
Assert.IsTrue(x.Value >= 100);
diff --git a/src/AD.FsCheck.MSTest.Tests.Arbitraries/_usings.cs b/src/AD.FsCheck.MSTest.Tests.Arbitraries/_usings.cs
index a753791..81ece07 100644
--- a/src/AD.FsCheck.MSTest.Tests.Arbitraries/_usings.cs
+++ b/src/AD.FsCheck.MSTest.Tests.Arbitraries/_usings.cs
@@ -1 +1,2 @@
global using FsCheck;
+global using FsCheck.Fluent;
diff --git a/src/AD.FsCheck.MSTest.Tests/AD.FsCheck.MSTest.Tests.csproj b/src/AD.FsCheck.MSTest.Tests/AD.FsCheck.MSTest.Tests.csproj
index f9f5d0b..96b48d3 100644
--- a/src/AD.FsCheck.MSTest.Tests/AD.FsCheck.MSTest.Tests.csproj
+++ b/src/AD.FsCheck.MSTest.Tests/AD.FsCheck.MSTest.Tests.csproj
@@ -7,8 +7,8 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxNbOfTest.cs b/src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxTest.cs
similarity index 50%
rename from src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxNbOfTest.cs
rename to src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxTest.cs
index 263972d..65e131d 100644
--- a/src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxNbOfTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/ClassAndMethodMaxTest.cs
@@ -2,13 +2,13 @@
#pragma warning disable IDE0060 // Remove unused parameter
-[Properties(MaxNbOfTest = ClassMaxNbOfTest)]
-public sealed class ClassAndMethodMaxNbOfTest : CommandLineTest
+[Properties(MaxTest = ClassMaxTest)]
+public sealed class ClassAndMethodMaxTest : CommandLineTest
{
- const int ClassMaxNbOfTest = 20;
- const int MethodMaxNbOfTest = 30;
+ const int ClassMaxTest = 20;
+ const int MethodMaxTest = 30;
- public ClassAndMethodMaxNbOfTest() : base(nameof(ClassAndMethodMaxNbOfTest))
+ public ClassAndMethodMaxTest() : base(nameof(ClassAndMethodMaxTest))
{ }
[CommandLineProperty]
@@ -16,14 +16,14 @@ public void Class_is_inherited(int a)
{ }
[TestMethod]
- public async Task Class_is_inherited_test() => AreEqual(ClassMaxNbOfTest, await AssertSuccess(nameof(Class_is_inherited)));
+ public async Task Class_is_inherited_test() => AreEqual(ClassMaxTest, await AssertSuccess(nameof(Class_is_inherited)));
- [CommandLineProperty(MaxNbOfTest = MethodMaxNbOfTest)]
+ [CommandLineProperty(MaxTest = MethodMaxTest)]
public void Method_overrides_class(int a)
{ }
[TestMethod]
- public async Task Method_overrides_class_test() => AreEqual(MethodMaxNbOfTest, await AssertSuccess(nameof(Method_overrides_class)));
+ public async Task Method_overrides_class_test() => AreEqual(MethodMaxTest, await AssertSuccess(nameof(Method_overrides_class)));
}
#pragma warning restore IDE0060 // Remove unused parameter
diff --git a/src/AD.FsCheck.MSTest.Tests/ClassMaxNbOfTest.cs b/src/AD.FsCheck.MSTest.Tests/ClassMaxNbOfTest.cs
deleted file mode 100644
index 56b06a1..0000000
--- a/src/AD.FsCheck.MSTest.Tests/ClassMaxNbOfTest.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace AD.FsCheck.MSTest.Tests;
-
-#pragma warning disable IDE0060 // Remove unused parameter
-
-[Properties(MaxNbOfTest = MaxNbOfTest)]
-public sealed class ClassMaxNbOfTest : CommandLineTest
-{
- const int MaxNbOfTest = 20;
-
- public ClassMaxNbOfTest() : base(nameof(ClassMaxNbOfTest))
- { }
-
- [CommandLineProperty]
- public void Method(int a)
- { }
-
- [TestMethod]
- public async Task Method_test() => AreEqual(MaxNbOfTest, await AssertSuccess(nameof(Method)));
-}
-
-#pragma warning restore IDE0060 // Remove unused parameter
diff --git a/src/AD.FsCheck.MSTest.Tests/ClassMaxTest.cs b/src/AD.FsCheck.MSTest.Tests/ClassMaxTest.cs
new file mode 100644
index 0000000..5cbd1f3
--- /dev/null
+++ b/src/AD.FsCheck.MSTest.Tests/ClassMaxTest.cs
@@ -0,0 +1,21 @@
+namespace AD.FsCheck.MSTest.Tests;
+
+#pragma warning disable IDE0060 // Remove unused parameter
+
+[Properties(MaxTest = MaxTest)]
+public sealed class ClassMaxTest : CommandLineTest
+{
+ const int MaxTest = 20;
+
+ public ClassMaxTest() : base(nameof(ClassMaxTest))
+ { }
+
+ [CommandLineProperty]
+ public void Method(int a)
+ { }
+
+ [TestMethod]
+ public async Task Method_test() => AreEqual(MaxTest, await AssertSuccess(nameof(Method)));
+}
+
+#pragma warning restore IDE0060 // Remove unused parameter
diff --git a/src/AD.FsCheck.MSTest.Tests/DurationTest.cs b/src/AD.FsCheck.MSTest.Tests/DurationTest.cs
index 4877dcb..cf03b3a 100644
--- a/src/AD.FsCheck.MSTest.Tests/DurationTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/DurationTest.cs
@@ -9,7 +9,7 @@ public sealed class DurationTest : CommandLineTest
public DurationTest() : base(nameof(DurationTest))
{ }
- [Property(MaxNbOfTest = NbOfTest)]
+ [Property(MaxTest = NbOfTest)]
public async Task Duration(int _) => await Task.Delay(Yield);
[TestMethod]
diff --git a/src/AD.FsCheck.MSTest.Tests/InvokeErrorTest.cs b/src/AD.FsCheck.MSTest.Tests/InvokeErrorTest.cs
index 6bc4725..30d7855 100644
--- a/src/AD.FsCheck.MSTest.Tests/InvokeErrorTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/InvokeErrorTest.cs
@@ -18,7 +18,7 @@ public void CannotGenerate(NotGeneratable _)
public async Task CannotGenerate_test()
{
var msg = await Run(nameof(CannotGenerate), Fetch.StdErr);
- AreEqual($"The type {typeof(NotGeneratable).FullName} is not handled automatically by FsCheck. Consider using another type or writing and registering a generator for it.",
+ AreEqual($"The type {typeof(NotGeneratable).FullName} is not handled automatically by FsCheck. Consider using another type or writing a generator for it.",
msg);
}
}
diff --git a/src/AD.FsCheck.MSTest.Tests/MethodMaxNbOfTest.cs b/src/AD.FsCheck.MSTest.Tests/MethodMaxNbOfTest.cs
deleted file mode 100644
index 13990db..0000000
--- a/src/AD.FsCheck.MSTest.Tests/MethodMaxNbOfTest.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace AD.FsCheck.MSTest.Tests;
-
-#pragma warning disable IDE0060 // Remove unused parameter
-
-[TestClass]
-public sealed class MethodMaxNbOfTest : CommandLineTest
-{
- const int MaxNbOfTest = 30;
-
- public MethodMaxNbOfTest() : base(nameof(MethodMaxNbOfTest))
- { }
-
- [CommandLineProperty(MaxNbOfTest = MaxNbOfTest)]
- public void Method(int a)
- { }
-
- [TestMethod]
- public async Task Method_test() => AreEqual(MaxNbOfTest, await AssertSuccess(nameof(Method)));
-}
-
-#pragma warning restore IDE0060 // Remove unused parameter
diff --git a/src/AD.FsCheck.MSTest.Tests/MethodMaxTest.cs b/src/AD.FsCheck.MSTest.Tests/MethodMaxTest.cs
new file mode 100644
index 0000000..14f80ec
--- /dev/null
+++ b/src/AD.FsCheck.MSTest.Tests/MethodMaxTest.cs
@@ -0,0 +1,21 @@
+namespace AD.FsCheck.MSTest.Tests;
+
+#pragma warning disable IDE0060 // Remove unused parameter
+
+[TestClass]
+public sealed class MethodMaxTest : CommandLineTest
+{
+ const int MaxTest = 30;
+
+ public MethodMaxTest() : base(nameof(MethodMaxTest))
+ { }
+
+ [CommandLineProperty(MaxTest = MaxTest)]
+ public void Method(int a)
+ { }
+
+ [TestMethod]
+ public async Task Method_test() => AreEqual(MaxTest, await AssertSuccess(nameof(Method)));
+}
+
+#pragma warning restore IDE0060 // Remove unused parameter
diff --git a/src/AD.FsCheck.MSTest.Tests/ParametersTest.cs b/src/AD.FsCheck.MSTest.Tests/ParametersTest.cs
index f933f33..33fea07 100644
--- a/src/AD.FsCheck.MSTest.Tests/ParametersTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/ParametersTest.cs
@@ -37,7 +37,7 @@ public void One_parameter(int a)
#region Two
[CommandLineProperty]
- public void Two_parameters(int a, int b)
+ public void Two_parameters(int a, string b)
{ }
[TestMethod]
@@ -48,7 +48,7 @@ public void Two_parameters(int a, int b)
#region Three
[CommandLineProperty]
- public void Three_parameters(int a, int b, int c)
+ public void Three_parameters(int a, string b, Guid c)
{ }
[TestMethod]
@@ -59,7 +59,7 @@ public void Three_parameters(int a, int b, int c)
#region Four
[CommandLineProperty]
- public void Four_parameters(int a, int b, int c, int d)
+ public void Four_parameters(int a, string b, Guid c, double d)
{ }
[TestMethod]
@@ -70,7 +70,7 @@ public void Four_parameters(int a, int b, int c, int d)
#region Five
[CommandLineProperty]
- public void Five_parameters(int a, int b, int c, int d, int e)
+ public void Five_parameters(int a, string b, Guid c, double d, decimal e)
{ }
[TestMethod]
@@ -81,7 +81,7 @@ public void Five_parameters(int a, int b, int c, int d, int e)
#region Six
[CommandLineProperty]
- public void Six_parameters(int a, int b, int c, int d, int e, int f)
+ public void Six_parameters(int a, string b, Guid c, double d, decimal e, byte f)
{ }
[TestMethod]
@@ -92,7 +92,7 @@ public void Six_parameters(int a, int b, int c, int d, int e, int f)
#region Seven
[CommandLineProperty]
- public void Seven_parameters(int a, int b, int c, int d, int e, int f, int g)
+ public void Seven_parameters(int a, string b, Guid c, double d, decimal e, byte f, DateTime g)
{ }
[TestMethod]
@@ -103,7 +103,7 @@ public void Seven_parameters(int a, int b, int c, int d, int e, int f, int g)
#region Eight
[CommandLineProperty]
- public void Eight_parameters(int a, int b, int c, int d, int e, int f, int g, int h)
+ public void Eight_parameters(int a, string b, Guid c, double d, decimal e, byte f, DateTime g, char h)
{ }
[TestMethod]
diff --git a/src/AD.FsCheck.MSTest.Tests/PropertiesReplayTest.cs b/src/AD.FsCheck.MSTest.Tests/PropertiesReplayTest.cs
index 88052e6..bab5e87 100644
--- a/src/AD.FsCheck.MSTest.Tests/PropertiesReplayTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/PropertiesReplayTest.cs
@@ -1,6 +1,6 @@
namespace AD.FsCheck.MSTest.Tests;
-[Properties(Replay = "1561428431,297099475")]
+[Properties(Replay = "10333802694858096737,13365262137747244545")]
public sealed class PropertiesReplayTest : CommandLineTest
{
public PropertiesReplayTest() : base(nameof(PropertiesReplayTest))
@@ -13,6 +13,6 @@ public PropertiesReplayTest() : base(nameof(PropertiesReplayTest))
public async Task Prop_test()
{
var msg = await Run(nameof(Prop), Fetch.StdErr);
- IsTrue(msg.StartsWith("Falsifiable, after 28 tests (1 shrink) (StdGen (1561428431,297099475))"));
+ IsTrue(msg.StartsWith("Falsifiable, after 20 tests (2 shrinks) (10333802694858096737,13365262137747244545)"));
}
}
diff --git a/src/AD.FsCheck.MSTest.Tests/PropertyReplayTest.cs b/src/AD.FsCheck.MSTest.Tests/PropertyReplayTest.cs
index c1e97e9..1652ef6 100644
--- a/src/AD.FsCheck.MSTest.Tests/PropertyReplayTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/PropertyReplayTest.cs
@@ -6,19 +6,19 @@ public sealed class PropertyReplayTest : CommandLineTest
public PropertyReplayTest() : base(nameof(PropertyReplayTest))
{ }
- [CommandLineProperty(Replay = "1561428431,297099475")]
+ [CommandLineProperty(Replay = "1358818329932720880,1613334182980143787")]
public void Prop1(int a) => IsTrue(a < 17);
[TestMethod]
public async Task Prop1_test() => await Run(nameof(Prop1));
- [CommandLineProperty(Replay = " 1561428431 , 297099475 ")]
+ [CommandLineProperty(Replay = " 1358818329932720880 , 1613334182980143787 ")]
public void Prop2(int a) => IsTrue(a < 17);
[TestMethod]
public async Task Prop2_test() => await Run(nameof(Prop2));
- [CommandLineProperty(Replay = "(1561428431,297099475)")]
+ [CommandLineProperty(Replay = "(1358818329932720880,1613334182980143787)")]
public void Prop3(int a) => IsTrue(a < 17);
[TestMethod]
@@ -27,6 +27,6 @@ public PropertyReplayTest() : base(nameof(PropertyReplayTest))
async Task Run(string testName)
{
var msg = await Run(testName, Fetch.StdErr);
- IsTrue(msg.StartsWith("Falsifiable, after 28 tests (1 shrink) (StdGen (1561428431,297099475))"));
+ IsTrue(msg.StartsWith("Falsifiable, after 25 tests (3 shrinks) (1358818329932720880,1613334182980143787)"));
}
}
diff --git a/src/AD.FsCheck.MSTest.Tests/ReplayPrecedenceTest.cs b/src/AD.FsCheck.MSTest.Tests/ReplayPrecedenceTest.cs
index c91e4a1..ce13cca 100644
--- a/src/AD.FsCheck.MSTest.Tests/ReplayPrecedenceTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/ReplayPrecedenceTest.cs
@@ -6,13 +6,13 @@ public sealed class ReplayPrecedenceTest : CommandLineTest
public ReplayPrecedenceTest() : base(nameof(ReplayPrecedenceTest))
{ }
- [CommandLineProperty(Replay = "1561428431,297099475")]
+ [CommandLineProperty(Replay = "5195330141687306492,9724345478383734501")]
public void Prop(int a) => IsTrue(a < 17);
[TestMethod]
public async Task Prop_test()
{
var msg = await Run(nameof(Prop), Fetch.StdErr);
- IsTrue(msg.StartsWith("Falsifiable, after 28 tests (1 shrink) (StdGen (1561428431,297099475))"));
+ IsTrue(msg.StartsWith("Falsifiable, after 21 tests (2 shrinks) (5195330141687306492,9724345478383734501)"));
}
}
diff --git a/src/AD.FsCheck.MSTest.Tests/VectorTest.cs b/src/AD.FsCheck.MSTest.Tests/VectorTest.cs
index 7444d14..a982b65 100644
--- a/src/AD.FsCheck.MSTest.Tests/VectorTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/VectorTest.cs
@@ -7,7 +7,7 @@ public record Vector(int X, int Y)
public static Vector PlusIdentity { get; } = new(0, 0);
}
-[Properties(MaxNbOfTest = 1000)]
+[Properties(MaxTest = 1000)]
public sealed class VectorTest
{
[Property]
@@ -23,7 +23,7 @@ public sealed class VectorTest
[TestClass]
public sealed class VectorSerializationTest
{
- [Property(MaxNbOfTest = 10)]
+ [Property(MaxTest = 10)]
public async Task Serialize_and_deserialize(Vector expected)
{
var actual = await Deserialize(await Serialize(expected));
diff --git a/src/AD.FsCheck.MSTest.Tests/VerbosePropertiesTest.cs b/src/AD.FsCheck.MSTest.Tests/VerbosePropertiesTest.cs
index a373c0f..5c2d7cb 100644
--- a/src/AD.FsCheck.MSTest.Tests/VerbosePropertiesTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/VerbosePropertiesTest.cs
@@ -1,9 +1,9 @@
namespace AD.FsCheck.MSTest.Tests;
-[Properties(MaxNbOfTest = MaxNbOfTest, Verbose = true)]
+[Properties(MaxTest = MaxTest, Verbose = true)]
public sealed class VerbosePropertiesTest : CommandLineTest
{
- const int MaxNbOfTest = 20;
+ const int MaxTest = 20;
public VerbosePropertiesTest() : base(nameof(VerbosePropertiesTest))
{ }
@@ -12,13 +12,13 @@ public VerbosePropertiesTest() : base(nameof(VerbosePropertiesTest))
public void Verbose(int a, int b) => AreEqual(a + b, b + a);
[TestMethod]
- public async Task Verbose_test() => await Test(nameof(Verbose), MaxNbOfTest + 1);
+ public async Task Verbose_test() => await Test(nameof(Verbose), MaxTest + 1);
[CommandLineProperty(Verbose = false)]
public void NotVerbose(int a, int b) => AreEqual(a + b, b + a);
[TestMethod]
- public async Task NotVerbose_test() => await Test(nameof(NotVerbose), MaxNbOfTest + 1);
+ public async Task NotVerbose_test() => await Test(nameof(NotVerbose), MaxTest + 1);
//when 'Verbose' is set to true for the class, it cannot be set to false for a single property
async Task Test(string testName, int expectedLines)
diff --git a/src/AD.FsCheck.MSTest.Tests/VerboseTest.cs b/src/AD.FsCheck.MSTest.Tests/VerboseTest.cs
index 3f5eb6e..ccf776e 100644
--- a/src/AD.FsCheck.MSTest.Tests/VerboseTest.cs
+++ b/src/AD.FsCheck.MSTest.Tests/VerboseTest.cs
@@ -1,9 +1,9 @@
namespace AD.FsCheck.MSTest.Tests;
-[Properties(MaxNbOfTest = MaxNbOfTest)]
+[Properties(MaxTest = MaxTest)]
public sealed class VerboseTest : CommandLineTest
{
- const int MaxNbOfTest = 20;
+ const int MaxTest = 20;
public VerboseTest() : base(nameof(VerboseTest))
{ }
@@ -12,7 +12,7 @@ public VerboseTest() : base(nameof(VerboseTest))
public void Verbose(int a, int b) => AreEqual(a + b, b + a);
[TestMethod]
- public async Task Verbose_test() => await Test(nameof(Verbose), MaxNbOfTest + 1);
+ public async Task Verbose_test() => await Test(nameof(Verbose), MaxTest + 1);
[CommandLineProperty]
public void NotVerbose(int a, int b) => AreEqual(a + b, b + a);
diff --git a/src/AD.FsCheck.MSTest/AD.FsCheck.MSTest.csproj b/src/AD.FsCheck.MSTest/AD.FsCheck.MSTest.csproj
index e381348..9e35fc1 100644
--- a/src/AD.FsCheck.MSTest/AD.FsCheck.MSTest.csproj
+++ b/src/AD.FsCheck.MSTest/AD.FsCheck.MSTest.csproj
@@ -1,10 +1,12 @@
+
+ netstandard2.0;net8.0
True
$(MSBuildProjectName.Replace("AD", "AndreasDorfer"))
False
- 1.1.2
+ 3.0.0-rc1.2
Andreas Dorfer
Integrates FsCheck with MSTest.
https://github.com/Andreas-Dorfer/fscheck-mstest
@@ -22,8 +24,8 @@
-
-
+
+
diff --git a/src/AD.FsCheck.MSTest/ConfigurationExtensions.cs b/src/AD.FsCheck.MSTest/ConfigurationExtensions.cs
index a0c925f..71312f1 100644
--- a/src/AD.FsCheck.MSTest/ConfigurationExtensions.cs
+++ b/src/AD.FsCheck.MSTest/ConfigurationExtensions.cs
@@ -1,30 +1,37 @@
-using static FsCheck.Random;
+using Microsoft.FSharp.Core;
namespace AD.FsCheck.MSTest;
///
-/// Extension methods for .
+/// Extension methods for .
///
public static class ConfigurationExtensions
{
- static string? FromStdGen(StdGen? stdGen)
+ static string? FromReplay(Replay? replay)
{
- if (stdGen is null) return null;
- return $"{stdGen.Item1},{stdGen.Item2}";
+ if (replay is null) return null;
+ var replayString = $"{replay.Rnd.Seed},{replay.Rnd.Gamma}";
+ var size = OptionModule.ToNullable(replay.Size);
+ if (size is not null)
+ {
+ replayString += $",{size.Value}";
+ }
+ return replayString;
}
///
- /// Converts a to a .
+ /// Converts a to a .
///
- /// The to convert.
+ /// The to convert.
/// The created .
- public static IRunConfiguration ToRunConfiguration(this Configuration configuration) =>
+ public static IRunConfiguration ToRunConfiguration(this Config configuration) =>
new RunConfiguration(
- configuration.MaxNbOfTest,
- configuration.MaxNbOfFailedTests,
+ configuration.MaxTest,
+ configuration.MaxRejected,
configuration.StartSize,
configuration.EndSize,
- FromStdGen(configuration.Replay),
+ FromReplay(OptionModule.ToObj(configuration.Replay)),
false, //Verbose cannot be inferred from a Configuration
- configuration.QuietOnSuccess);
+ configuration.QuietOnSuccess,
+ []);
}
diff --git a/src/AD.FsCheck.MSTest/IRunConfiguration.cs b/src/AD.FsCheck.MSTest/IRunConfiguration.cs
index bf1ae73..4c14f2e 100644
--- a/src/AD.FsCheck.MSTest/IRunConfiguration.cs
+++ b/src/AD.FsCheck.MSTest/IRunConfiguration.cs
@@ -8,12 +8,12 @@ public interface IRunConfiguration
///
/// The maximum number of tests that are run.
///
- int MaxNbOfTest { get; }
+ int MaxTest { get; }
///
/// The maximum number of tests where values are rejected.
///
- int MaxNbOfFailedTests { get; }
+ int MaxRejected { get; }
///
/// The size to use for the first test.
@@ -39,4 +39,9 @@ public interface IRunConfiguration
/// Suppresses the output from the test if the test is successful.
///
bool QuietOnSuccess { get; }
+
+ ///
+ /// The Arbitrary instances to use for this test method.
+ ///
+ Type[] Arbitrary{ get; }
}
diff --git a/src/AD.FsCheck.MSTest/IsExternalInit.cs b/src/AD.FsCheck.MSTest/IsExternalInit.cs
new file mode 100644
index 0000000..f11b0fd
--- /dev/null
+++ b/src/AD.FsCheck.MSTest/IsExternalInit.cs
@@ -0,0 +1,10 @@
+// from https://github.com/dotnet/runtime/blob/48ae96799fa048302d5e323cee204ae7fbb4edde/src/tasks/Common/IsExternalInit.cs
+
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// ReSharper disable once CheckNamespace
+namespace System.Runtime.CompilerServices
+{
+ internal sealed class IsExternalInit { }
+}
\ No newline at end of file
diff --git a/src/AD.FsCheck.MSTest/MSTestRunner.cs b/src/AD.FsCheck.MSTest/MSTestRunner.cs
index b4b8115..6a261de 100644
--- a/src/AD.FsCheck.MSTest/MSTestRunner.cs
+++ b/src/AD.FsCheck.MSTest/MSTestRunner.cs
@@ -34,12 +34,13 @@ public void OnShrink(FSharpList