mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-06 04:58:39 +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
|
||||
}
|
Reference in New Issue
Block a user