Skip to content

Commit d0306f0

Browse files
vzarytovskiibaronfel
authored andcommitted
[WIP] Migrate Compiler.UnitTests to xUnit
1 parent d38b1a3 commit d0306f0

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

FSharpBuild.Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<!-- directory locations -->
1111
<PropertyGroup>
1212
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
13+
<FSharpTestsRoot>$(RepoRoot)tests</FSharpTestsRoot>
1314
<SymStoreDirectory>$(ArtifactsDir)\SymStore</SymStoreDirectory>
1415
<ProtoOutputPath>$(ArtifactsDir)\Bootstrap</ProtoOutputPath>
1516
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@
187187
<StrawberryPerlVersion>5.28.0.1</StrawberryPerlVersion>
188188
<StreamJsonRpcVersion>2.0.187</StreamJsonRpcVersion>
189189
<XUnitVersion>2.4.1</XUnitVersion>
190-
<FluentAssertionsVersion>2.4.1</FluentAssertionsVersion>
190+
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
191191
</PropertyGroup>
192192
</Project>

tests/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
1010
</ItemGroup>
1111
<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
12+
<!-- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" /> -->
1313
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
1414
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitVersion)" />
1515
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace FSharp.Test.Utilities
2+
3+
module Assert =
4+
open FluentAssertions
5+
open System.Collections
6+
7+
let inline shouldBe (expected : ^T) (actual : ^U) =
8+
actual.Should().Be(expected, "") |> ignore
9+
10+
let inline shouldBeEmpty (actual : ^T when ^T :> IEnumerable) =
11+
actual.Should().BeEmpty("") |> ignore
12+
13+
let inline shouldNotBeEmpty (actual : ^T when ^T :> IEnumerable) =
14+
actual.Should().NotBeEmpty("") |> ignore
15+
16+
let shouldBeFalse (actual: bool) =
17+
actual.Should().BeFalse("") |> ignore
18+
19+
let shouldBeTrue (actual: bool) =
20+
actual.Should().BeTrue("") |> ignore

tests/FSharp.Test.Utilities/FSharp.TestHelpers.fsproj renamed to tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<Compile Include="ILChecker.fs" />
2222
<Compile Include="Utilities.fs" />
2323
<Compile Include="CompilerAssert.fs" />
24+
<Compile Include="Assert.fs" />
2425
</ItemGroup>
2526

2627
<ItemGroup>

0 commit comments

Comments
 (0)