mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-05 12:38:39 +00:00
Add snapshotList syntax for sequences (#25)
This commit is contained in:
32
WoofWare.Expect.Test/TestSnapshotList.fs
Normal file
32
WoofWare.Expect.Test/TestSnapshotList.fs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace WoofWare.Expect.Test
|
||||
|
||||
open NUnit.Framework
|
||||
open WoofWare.Expect
|
||||
|
||||
[<TestFixture>]
|
||||
module TestSnapshotList =
|
||||
[<OneTimeSetUp>]
|
||||
let ``Prepare to bulk-update tests`` () =
|
||||
// If you don't want to enter bulk-update mode, just replace this line with a no-op `()`.
|
||||
// The `updateAllSnapshots` tear-down below will simply do nothing in that case.
|
||||
// GlobalBuilderConfig.enterBulkUpdateMode ()
|
||||
()
|
||||
|
||||
[<OneTimeTearDown>]
|
||||
let ``Update all tests`` () =
|
||||
GlobalBuilderConfig.updateAllSnapshots ()
|
||||
|
||||
[<Test>]
|
||||
let ``simple list test`` () =
|
||||
expect {
|
||||
snapshotList [ "1" ; "2" ; "3" ]
|
||||
return [ 1..3 ]
|
||||
}
|
||||
|
||||
[<Test>]
|
||||
let ``list test with formatting`` () =
|
||||
expect {
|
||||
snapshotList [ "8" ; "9" ; "0" ; "1" ; "2" ]
|
||||
withFormat (fun x -> string<int> (x % 10))
|
||||
return [ 8..12 ]
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
<Compile Include="TestDiff.fs" />
|
||||
<Compile Include="TestDot.fs" />
|
||||
<Compile Include="TestExceptionThrowing.fs" />
|
||||
<Compile Include="TestSnapshotList.fs" />
|
||||
<Compile Include="TestSurface.fs" />
|
||||
<Compile Include="TestSnapshotFinding\TestSnapshotFinding.fs" />
|
||||
<Compile Include="TestSnapshotFinding\TestUnicodeCharacters.fs" />
|
||||
|
Reference in New Issue
Block a user