mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-11 15:08:41 +00:00
Initial commit
This commit is contained in:
37
WoofWare.Expect.Test/SimpleTest.fs
Normal file
37
WoofWare.Expect.Test/SimpleTest.fs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace WoofWare.Expect.Test
|
||||
|
||||
open System
|
||||
open WoofWare.Expect
|
||||
open NUnit.Framework
|
||||
|
||||
[<TestFixture>]
|
||||
module SimpleTest =
|
||||
[<Test>]
|
||||
let ``JSON is resilient to whitespace changes`` () =
|
||||
expect {
|
||||
snapshotJson "123 "
|
||||
return 123
|
||||
}
|
||||
|
||||
[<Test>]
|
||||
let ``Example of a failing test`` () =
|
||||
expect {
|
||||
snapshot
|
||||
"snapshot mismatch! snapshot at filepath.fs:32 (Example of a failing test) was:
|
||||
|
||||
- 123
|
||||
|
||||
actual was:
|
||||
|
||||
+ 124"
|
||||
|
||||
return
|
||||
Assert
|
||||
.Throws<Exception>(fun () ->
|
||||
expectWithMockedFilePath "filepath.fs" {
|
||||
snapshot "123"
|
||||
return 124
|
||||
}
|
||||
)
|
||||
.Message
|
||||
}
|
24
WoofWare.Expect.Test/TestSurface.fs
Normal file
24
WoofWare.Expect.Test/TestSurface.fs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace WoofWare.Expect.Test
|
||||
|
||||
open ApiSurface
|
||||
open NUnit.Framework
|
||||
|
||||
[<TestFixture>]
|
||||
module TestSurface =
|
||||
let assembly = typeof<WoofWare.Expect.ExpectBuilder>.Assembly
|
||||
|
||||
[<Test>]
|
||||
let ``Ensure API surface has not been modified`` () = ApiSurface.assertIdentical assembly
|
||||
|
||||
[<Test ; Explicit>]
|
||||
let ``Update API surface`` () =
|
||||
ApiSurface.writeAssemblyBaseline assembly
|
||||
|
||||
[<Test>]
|
||||
let ``Ensure public API is fully documented`` () =
|
||||
DocCoverage.assertFullyDocumented assembly
|
||||
|
||||
[<Test ; Explicit "Not yet published">]
|
||||
// https://github.com/nunit/nunit3-vs-adapter/issues/876
|
||||
let ``EnsureVersionIsMonotonic`` () =
|
||||
MonotonicVersion.validate assembly "WoofWare.Expect"
|
25
WoofWare.Expect.Test/WoofWare.Expect.Test.fsproj
Normal file
25
WoofWare.Expect.Test/WoofWare.Expect.Test.fsproj
Normal file
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="SimpleTest.fs" />
|
||||
<Compile Include="TestSurface.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ApiSurface" Version="4.1.20" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1"/>
|
||||
<PackageReference Include="NUnit" Version="4.3.2"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WoofWare.Expect\WoofWare.Expect.fsproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user