Skip to content

Commit 4fab31e

Browse files
Feature/nuget update (#15)
nuget update
1 parent e907fa3 commit 4fab31e

File tree

7 files changed

+23
-28
lines changed

7 files changed

+23
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# AD.FsCheck.MSTest
33
Integrates [FsCheck](https://fscheck.github.io/FsCheck/) with [MSTest](https://github.com/microsoft/testfx/). Inspired by FsCheck's own [Xunit integration](https://www.nuget.org/packages/FsCheck.Xunit).
44
## NuGet Package
5-
PM> Install-Package AndreasDorfer.FsCheck.MSTest -Version 1.1.0
5+
PM> Install-Package AndreasDorfer.FsCheck.MSTest -Version 1.1.1
66
## TLDR
77
Without `AD.FsCheck.MSTest` your tests look like this:
88
```csharp

src/AD.FsCheck.MSTest.FsTests/AD.FsCheck.MSTest.FsTests.fsproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<IsPackable>false</IsPackable>
@@ -11,10 +11,10 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
15-
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
16-
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
17-
<PackageReference Include="coverlet.collector" Version="6.0.0">
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
15+
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
16+
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
17+
<PackageReference Include="coverlet.collector" Version="6.0.2">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>
@@ -24,4 +24,8 @@
2424
<ProjectReference Include="..\AD.FsCheck.MSTest\AD.FsCheck.MSTest.csproj" />
2525
</ItemGroup>
2626

27+
<ItemGroup>
28+
<PackageReference Update="FSharp.Core" Version="8.0.200" />
29+
</ItemGroup>
30+
2731
</Project>

src/AD.FsCheck.MSTest.FsTests/VectorTest.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Vector =
1616
type VectorTest () =
1717

1818
[<Property>]
19-
member _.``Plus is commutative`` (a: Vector, b) = AreEqual<_> (a + b, b + a)
19+
member _.``Plus is commutative`` (a: Vector, b) = AreEqual<Vector> (a + b, b + a)
2020

2121
[<Property>]
22-
member _.``Plus is associative`` (a: Vector, b, c) = AreEqual<_> (a + b + c, a + (b + c))
22+
member _.``Plus is associative`` (a: Vector, b, c) = AreEqual<Vector> (a + b + c, a + (b + c))
2323

2424
[<Property>]
25-
member _.``There is a plus identity element`` a = AreEqual<_> (a, a + Vector.plusIdentity)
25+
member _.``There is a plus identity element`` a = AreEqual<Vector> (a, a + Vector.plusIdentity)
2626

2727
[<TestClass>]
2828
type VectorSerializationTest () =
@@ -43,5 +43,5 @@ type VectorSerializationTest () =
4343
member _.```Serialize and deserialize`` expected : Task = task {
4444
let! data = expected |> serialize
4545
let! actual = data |> deserialize
46-
AreEqual<_> (expected, actual)
46+
AreEqual<Vector> (expected, actual)
4747
}

src/AD.FsCheck.MSTest.Tests/AD.FsCheck.MSTest.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
9-
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
10-
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
11-
<PackageReference Include="coverlet.collector" Version="6.0.0">
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
9+
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
10+
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
11+
<PackageReference Include="coverlet.collector" Version="6.0.2">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>

src/AD.FsCheck.MSTest.Tests/CommandLineTest.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace AD.FsCheck.MSTest.Tests;
66

7-
public abstract partial class CommandLineTest : IDisposable
7+
public abstract partial class CommandLineTest(string className) : IDisposable
88
{
99
public enum Fetch
1010
{
@@ -16,14 +16,7 @@ public enum Fetch
1616

1717
public const string EnvironmentVariable = "CommandLine";
1818

19-
readonly string className;
20-
readonly string fileName;
21-
22-
public CommandLineTest(string className)
23-
{
24-
this.className = className;
25-
fileName = CreateTestFileName();
26-
}
19+
readonly string fileName = Path.ChangeExtension(Path.GetTempFileName(), ".trx");
2720

2821
protected async Task<int> AssertSuccess(string testName)
2922
{
@@ -64,8 +57,6 @@ protected async Task<string> Run(string testName, Fetch fetch)
6457
return output;
6558
}
6659

67-
static string CreateTestFileName() => Path.ChangeExtension(Path.GetTempFileName(), ".trx");
68-
6960
async Task RunCommandLineTest(string testName) =>
7061
await Process.Start("dotnet", @"test ..\..\..\." +
7162
#if RELEASE

src/AD.FsCheck.MSTest/AD.FsCheck.MSTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<GenerateDocumentationFile>True</GenerateDocumentationFile>
55
<PackageId>$(MSBuildProjectName.Replace("AD", "AndreasDorfer"))</PackageId>
66
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
7-
<Version>1.1.0</Version>
7+
<Version>1.1.1</Version>
88
<Authors>Andreas Dorfer</Authors>
99
<Description>Integrates FsCheck with MSTest.</Description>
1010
<RepositoryUrl>https://github.com/Andreas-Dorfer/fscheck-mstest</RepositoryUrl>
@@ -23,7 +23,7 @@
2323

2424
<ItemGroup>
2525
<PackageReference Include="FsCheck" Version="2.16.6" />
26-
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
26+
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

src/AD.FsCheck.MSTest/PropertyAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ bool Invoke(object[] values)
153153
try
154154
{
155155
#pragma warning disable CS8974 // Converting method group to non-delegate type
156-
((Property)invokeInfo.Invoke(null, new object[] { Invoke })!).Check(fsCheckConfig);
156+
((Property)invokeInfo.Invoke(null, [Invoke])!).Check(fsCheckConfig);
157157
#pragma warning restore CS8974 // Converting method group to non-delegate type
158158
runException = ex;
159159
return true;

0 commit comments

Comments
 (0)