Add syntax for exceptions (#19)

This commit is contained in:
Patrick Stevens
2025-07-06 22:30:02 +01:00
committed by GitHub
parent 75899d5668
commit ca74c4816b
8 changed files with 104 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
namespace WoofWare.Expect.Test
open NUnit.Framework
open WoofWare.Expect
[<TestFixture>]
module TestExceptionThrowing =
[<Test>]
let ``Can throw an exception`` () =
expect {
snapshotThrows @"System.Exception: oh no"
return! (fun () -> failwith<int> "oh no")
}

View File

@@ -13,6 +13,7 @@
<Compile Include="Assembly.fs" />
<Compile Include="BulkUpdateExample.fs" />
<Compile Include="SimpleTest.fs" />
<Compile Include="TestExceptionThrowing.fs" />
<Compile Include="TestSurface.fs" />
<Compile Include="TestSnapshotFinding\TestSnapshotFinding.fs" />
<Compile Include="TestSnapshotFinding\TestUnicodeCharacters.fs" />