Skip to content

Commit

Permalink
chore: Update to NUnit 4 (#3016)
Browse files Browse the repository at this point in the history
* Update to NUnit 4

* Warn on FS1178
  • Loading branch information
nojaf committed Dec 13, 2023
1 parent 263685a commit 2e2e9e0
Show file tree
Hide file tree
Showing 29 changed files with 1,546 additions and 79 deletions.
7 changes: 6 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ Some common use cases include:
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<WarningsAsErrors>FS0025;FS1182</WarningsAsErrors>
<WarnOn>1182;3390;$(WarnOn)</WarnOn>
<!--
FS0025: Incomplete pattern matches on this expression.
FS1182 Unused variables
FS1178 does not support structural equality
-->
<WarnOn>1182;3390;1178;$(WarnOn)</WarnOn>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode>true</RestoreLockedMode>
<NoWarn>NU1603</NoWarn>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

<PackageVersion Include="CliWrap" Version="3.6.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageVersion Include="NUnit" Version="3.13.3"/>
<PackageVersion Include="NUnit" Version="4.0.1"/>
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="20.0.4" />
<PackageVersion Include="FsCheck" Version="2.16.5" />
<PackageVersion Include="FsUnit" Version="4.2.0" />
<PackageVersion Include="FsUnit" Version="6.0.0-alpha1" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Fantomas.Client.Tests/EndToEndTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type EndToEndTests() =
withVersion version (fun fsharpFile ->
backgroundTask {
let! version = service.VersionAsync(fsharpFile)
Assert.AreEqual(int FantomasResponseCode.Version, version.Code)
Assert.That(version.Code, Is.EqualTo(int FantomasResponseCode.Version))
})

[<TestCase("5.0.6")>]
Expand All @@ -98,7 +98,7 @@ type EndToEndTests() =
Cursor = None }

let! formatResponse = service.FormatDocumentAsync(request)
Assert.AreEqual(int FantomasResponseCode.Formatted, formatResponse.Code)
Assert.That(formatResponse.Code, Is.EqualTo(int FantomasResponseCode.Formatted))
})

[<TestCase("6.0.0-alpha-004")>]
Expand All @@ -112,5 +112,5 @@ type EndToEndTests() =
Cursor = Some(FormatCursorPosition(1, 12)) }

let! formatResponse = service.FormatDocumentAsync(request)
Assert.AreEqual(int FantomasResponseCode.Formatted, formatResponse.Code)
Assert.That(formatResponse.Code, Is.EqualTo(int FantomasResponseCode.Formatted))
})
Loading

0 comments on commit 2e2e9e0

Please sign in to comment.