Files
WoofWare.Expect/WoofWare.Expect.Test/SimpleTest.fs
2025-06-16 11:53:26 +01:00

44 lines
945 B
Forth

namespace WoofWare.Expect.Test
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:99 (Example of a failing test) was:
- 123
actual was:
+ 124"
return
Assert
.Throws<ExpectException>(fun () ->
expectWithMockedFilePath ("filepath.fs", 99) {
snapshot "123"
return 124
}
)
.Message
}
[<Test>]
let ``Basic example`` () =
expect {
snapshot @"123"
return 123
}