File tree 2 files changed +13
-4
lines changed
vsintegration/src/unittests
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,17 @@ module Asserts =
35
35
let message = sprintf " Expected S_OK"
36
36
printfn " %s " message
37
37
Assert.Fail( message)
38
-
38
+ let Throws < 'T when 'T :> Exception > f =
39
+ let error =
40
+ try
41
+ f ()
42
+ Some( sprintf " No exception occurred, expected %O " typeof< 'T>)
43
+ with
44
+ | :? 'T -> None
45
+ | e -> Some( sprintf " Wrong exception type occurred. Got %O , expecting %O " ( e.GetType()) typeof< 'T>)
46
+ match error with
47
+ | Some( msg) -> Assert.Fail( msg)
48
+ | None -> ()
39
49
40
50
module UIStuff =
41
51
let SetupSynchronizationContext () =
Original file line number Diff line number Diff line change @@ -774,9 +774,8 @@ type Utilities() =
774
774
Assert.AreEqual( 255 L, ProjectNode.ParsePropertyValueToInt64( " 0xFF" ))
775
775
Assert.AreEqual( null , ProjectNode.ParsePropertyValueToInt64( " " ))
776
776
Assert.AreEqual( null , ProjectNode.ParsePropertyValueToInt64( null ))
777
- Assert.Throws< Exception>( fun () -> ignore ( ProjectNode.ParsePropertyValueToInt64( " abc" ))) |> ignore
778
- Assert.Throws< Exception>( fun () -> ignore ( ProjectNode.ParsePropertyValueToInt64( " 12333333333333333333333333" ))) |> ignore
779
-
777
+ Throws< Exception>( fun () -> ignore ( ProjectNode.ParsePropertyValueToInt64( " abc" )))
778
+ Throws< Exception>( fun () -> ignore ( ProjectNode.ParsePropertyValueToInt64( " 12333333333333333333333333" )))
780
779
781
780
#if DEBUGGERVISUALIZER
782
781
module internal DebugViz =
You can’t perform that action at this time.
0 commit comments