diff --git a/Directory.Packages.props b/Directory.Packages.props index e4120e6..e61a4ea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + diff --git a/altcode.test/validation/Expecto.fs b/altcode.test/validation/Expecto.fs index bd1627e..f03eed9 100644 --- a/altcode.test/validation/Expecto.fs +++ b/altcode.test/validation/Expecto.fs @@ -2,6 +2,7 @@ namespace AltCode.Validation module Expecto = + open System open NUnit.Framework open AltCode.Test.Expecto @@ -45,44 +46,56 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(fun _ -> AltExpect.containsAll match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.containsAll "flipmatch1" match1) + ) |> ignore let match2 = { Actual = [ '1'; '2'; '3' ] Expected = [ '4'; '1' ] } - Assert.Throws(fun _ -> AltExpect.containsAll match2 "match2") + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match2 "match2") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch2" match2) + Assert.Throws( + Action(fun _ -> AltFlipExpect.containsAll "flipmatch2" match2) + ) |> ignore let match3 = { Actual = [ "1"; "2"; "3" ] Expected = [ "1"; "4" ] } - Assert.Throws(fun _ -> AltExpect.containsAll match3 "match3") + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match3 "match3") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch3" match3) + Assert.Throws( + Action(fun _ -> AltFlipExpect.containsAll "flipmatch3" match3) + ) |> ignore let match4 = { Actual = [ A; B 1; C "3" ] Expected = [ C "4"; A ] } - Assert.Throws(fun _ -> AltExpect.containsAll match4 "match4") + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match4 "match4") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch4" match4) + Assert.Throws( + Action(fun _ -> AltFlipExpect.containsAll "flipmatch4" match4) + ) |> ignore let diffPrinter a b = sprintf "%A.ne.%A" a b @@ -97,11 +110,14 @@ module Expecto = AltExpect.equalWithDiffPrinter diffPrinter match1 "match1" AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1 - Assert.Throws(fun _ -> AltExpect.notEqual match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.notEqual match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.notEqual "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.notEqual "flipmatch1" match1) + ) |> ignore [] @@ -110,19 +126,24 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(fun _ -> AltExpect.equal match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.equal match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.equal "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.equal "flipmatch1" match1) + ) |> ignore - Assert.Throws(fun _ -> - AltExpect.equalWithDiffPrinter diffPrinter match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.equalWithDiffPrinter diffPrinter match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1) + ) |> ignore AltExpect.notEqual match1 "match1" @@ -145,12 +166,14 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatClose accuracy match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.floatClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatClose "flipmatch1" accuracy match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatClose "flipmatch1" accuracy match1) + ) |> ignore [] @@ -166,12 +189,14 @@ module Expecto = let match1 = { Actual = -5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatGreaterThanOrClose accuracy match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.floatGreaterThanOrClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1) + ) |> ignore [] @@ -187,12 +212,14 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatLessThanOrClose accuracy match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.floatLessThanOrClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1) + ) |> ignore let fast () = accuracy @@ -249,12 +276,14 @@ module Expecto = let match1 = { Actual = slow; Expected = fast } - Assert.Throws(fun _ -> - AltExpect.isFasterThan match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isFasterThan match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isFasterThan "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isFasterThan "flipmatch1" match1) + ) |> ignore let fastfunc = @@ -296,12 +325,14 @@ module Expecto = { Actual = makeMeasurer slow Expected = makeMeasurer fast } - Assert.Throws(fun _ -> - AltExpect.isFasterThanSub match2 "match2") + Assert.Throws( + Action(fun _ -> AltExpect.isFasterThanSub match2 "match2") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isFasterThanSub "flipmatch2" match2) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isFasterThanSub "flipmatch2" match2) + ) |> ignore [] @@ -318,20 +349,24 @@ module Expecto = let isGreaterThanOrEqualShouldFail () = let match1 = { Actual = -5; Expected = 3 } - Assert.Throws(fun _ -> - AltExpect.isGreaterThanOrEqual match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isGreaterThanOrEqual match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1) + ) |> ignore - Assert.Throws(fun _ -> - AltExpect.isGreaterThan match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isGreaterThan match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isGreaterThan "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isGreaterThan "flipmatch1" match1) + ) |> ignore [] @@ -348,19 +383,24 @@ module Expecto = let isLessThanOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 3 } - Assert.Throws(fun _ -> - AltExpect.isLessThanOrEqual match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isLessThanOrEqual match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isLessThanOrEqual "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isLessThanOrEqual "flipmatch1" match1) + ) |> ignore - Assert.Throws(fun _ -> AltExpect.isLessThan match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isLessThan match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isLessThan "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isLessThan "flipmatch1" match1) + ) |> ignore [] @@ -381,11 +421,14 @@ module Expecto = (fun x -> x |> Seq.exists (fun y -> y.Success)) match1 - Assert.Throws(fun _ -> AltExpect.isNotMatch match1 "match1b") + Assert.Throws( + Action(fun _ -> AltExpect.isNotMatch match1 "match1b") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isNotMatch "flipmatch1b" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isNotMatch "flipmatch1b" match1) + ) |> ignore [] @@ -393,25 +436,32 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "x" } - Assert.Throws(fun _ -> AltExpect.isMatch match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.isMatch match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isMatch "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isMatch "flipmatch1" match1) + ) |> ignore - Assert.Throws(fun _ -> - AltExpect.isMatchGroups - match1 - (fun x -> x |> Seq.exists (fun y -> y.Success)) - "match1a") + Assert.Throws( + Action(fun _ -> + AltExpect.isMatchGroups + match1 + (fun x -> x |> Seq.exists (fun y -> y.Success)) + "match1a") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isMatchGroups - "flipmatch1a" - (fun x -> x |> Seq.exists (fun y -> y.Success)) - match1) + Assert.Throws( + Action(fun _ -> + AltFlipExpect.isMatchGroups + "flipmatch1a" + (fun x -> x |> Seq.exists (fun y -> y.Success)) + match1) + ) |> ignore AltExpect.isNotMatch match1 "match1b" @@ -430,12 +480,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws(fun _ -> - AltExpect.stringStarts match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.stringStarts match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringStarts "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringStarts "flipmatch1" match1) + ) |> ignore [] @@ -451,11 +503,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltExpect.stringEnds match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.stringEnds match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringEnds "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringEnds "flipmatch1" match1) + ) |> ignore [] @@ -471,12 +526,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> - AltExpect.stringContains match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.stringContains match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringContains "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringContains "flipmatch1" match1) + ) |> ignore [] @@ -503,12 +560,14 @@ module Expecto = let match1 = { Actual = s1; Expected = s2 } - Assert.Throws(fun _ -> - AltExpect.streamsEqual match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.streamsEqual match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.streamsEqual "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.streamsEqual "flipmatch1" match1) + ) |> ignore [] @@ -526,12 +585,14 @@ module Expecto = { Actual = [ B 5; B 1; B 2 ] Expected = [ B 1; B 5; B 3 ] } - Assert.Throws(fun _ -> - AltExpect.sequenceEqual match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.sequenceEqual match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceEqual "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.sequenceEqual "flipmatch1" match1) + ) |> ignore [] @@ -549,12 +610,14 @@ module Expecto = { Actual = [ B 5; B 1; B 2; B 3 ] Expected = [ B 1; B 5 ] } - Assert.Throws(fun _ -> - AltExpect.sequenceStarts match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.sequenceStarts match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceStarts "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.sequenceStarts "flipmatch1" match1) + ) |> ignore [] @@ -572,10 +635,12 @@ module Expecto = { Actual = [ B 5; B 1; B 2; B 3 ] Expected = [ B 1; B 5 ] } - Assert.Throws(fun _ -> - AltExpect.sequenceContainsOrder match1 "match1") + Assert.Throws( + Action(fun _ -> AltExpect.sequenceContainsOrder match1 "match1") + ) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceContainsOrder "flipmatch1" match1) + Assert.Throws( + Action(fun _ -> AltFlipExpect.sequenceContainsOrder "flipmatch1" match1) + ) |> ignore \ No newline at end of file diff --git a/altcode.test/validation/NUnit.fs b/altcode.test/validation/NUnit.fs index ee1bc76..040588a 100644 --- a/altcode.test/validation/NUnit.fs +++ b/altcode.test/validation/NUnit.fs @@ -27,7 +27,7 @@ module NUnit = (Constraint.Create().WithActual true).WithConstraint Is.Not.True let x1 = - Assert.Throws(fun _ -> AltAssert.That match1) + Assert.Throws(Action(fun _ -> AltAssert.That match1)) let expected = """ Assert.That(, ) @@ -41,7 +41,9 @@ module NUnit = (Constraint.Create().WithActual true).WithConstraint Is.Not.True let x2 = - Assert.Throws(fun _ -> AltAssert.That(match2, "some text")) + Assert.Throws( + Action(fun _ -> AltAssert.That(match2, "some text")) + ) let expected2 = " some text\n" @@ -76,26 +78,30 @@ module NUnit = let AreEqualShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> AltAssert.AreEqual match1) + Assert.Throws(Action(fun _ -> AltAssert.AreEqual match1)) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> AltAssert.AreEqual(match2, 0.1)) + Assert.Throws( + Action(fun _ -> AltAssert.AreEqual(match2, 0.1)) + ) |> ignore let match3 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> - AltAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match4 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> - AltAssert.AreEqual(match4, 0.1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.AreEqual(match4, 0.1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -112,13 +118,14 @@ module NUnit = let AreNotEqualShouldFail () = let match1 = { Actual = 5; Expected = 5 } - Assert.Throws(fun _ -> AltAssert.AreNotEqual match1) + Assert.Throws(Action(fun _ -> AltAssert.AreNotEqual match1)) |> ignore let match3 = { Actual = 5; Expected = 5 } - Assert.Throws(fun _ -> - AltAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -138,14 +145,15 @@ module NUnit = let match1 = { Actual = B 5; Expected = B 5 } - Assert.Throws(fun _ -> AltAssert.AreSame match1) + Assert.Throws(Action(fun _ -> AltAssert.AreSame match1)) |> ignore let match3 = { Actual = A; Expected = C "6" } - Assert.Throws(fun _ -> - AltAssert.AreSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.AreSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -166,13 +174,14 @@ module NUnit = let match1 = { Actual = x; Expected = x } - Assert.Throws(fun _ -> AltAssert.AreNotSame match1) + Assert.Throws(Action(fun _ -> AltAssert.AreNotSame match1)) |> ignore let match3 = { Actual = A; Expected = A } - Assert.Throws(fun _ -> - AltAssert.AreNotSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.AreNotSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -190,14 +199,15 @@ module NUnit = let GreaterShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> AltAssert.Greater match1) + Assert.Throws(Action(fun _ -> AltAssert.Greater match1)) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> - AltAssert.Greater(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.Greater(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -215,14 +225,17 @@ module NUnit = let GreaterOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> AltAssert.GreaterOrEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.GreaterOrEqual match1) + ) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> - AltAssert.GreaterOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.GreaterOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -240,14 +253,15 @@ module NUnit = let LessShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws(fun _ -> AltAssert.Less match1) + Assert.Throws(Action(fun _ -> AltAssert.Less match1)) |> ignore let match2 = { Actual = 5.0; Expected = 4.0 } - Assert.Throws(fun _ -> - AltAssert.Less(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.Less(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -265,14 +279,15 @@ module NUnit = let LessOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws(fun _ -> AltAssert.LessOrEqual match1) + Assert.Throws(Action(fun _ -> AltAssert.LessOrEqual match1)) |> ignore let match2 = { Actual = 5.0; Expected = 4.0 } - Assert.Throws(fun _ -> - AltAssert.LessOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltAssert.LessOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -305,24 +320,30 @@ module NUnit = let match1 = (AssertionMatch.Create().WithActual d1).WithExpected d2 - Assert.Throws(fun _ -> AltDirectoryAssert.AreEqual match1) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreEqual match1) + ) |> ignore let match2 = { Actual = d2; Expected = d1 } - Assert.Throws(fun _ -> - AltDirectoryAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match3 = { Actual = d1; Expected = d1 } - Assert.Throws(fun _ -> AltDirectoryAssert.AreNotEqual match3) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreNotEqual match3) + ) |> ignore let match4 = { Actual = d2; Expected = d2 } - Assert.Throws(fun _ -> - AltDirectoryAssert.AreNotEqual(match4, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreNotEqual(match4, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -344,21 +365,27 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> AltStringAssert.Contains match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.Contains match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.Contains(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.Contains(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(fun _ -> AltStringAssert.DoesNotContain match2) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotContain match2) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotContain(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotContain(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -369,11 +396,14 @@ module NUnit = AltStringAssert.DoesNotMatch match1 AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.IsMatch match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.IsMatch match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.IsMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.IsMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -381,11 +411,14 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "l" } - Assert.Throws(fun _ -> AltStringAssert.DoesNotMatch match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotMatch match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.IsMatch match1 @@ -399,11 +432,14 @@ module NUnit = AltStringAssert.EndsWith match1 AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.DoesNotEndWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotEndWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotEndWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotEndWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -411,11 +447,14 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltStringAssert.EndsWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.EndsWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.DoesNotEndWith match1 @@ -429,11 +468,15 @@ module NUnit = AltStringAssert.StartsWith match1 AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.DoesNotStartWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotStartWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotStartWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltStringAssert.DoesNotStartWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -441,11 +484,14 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws(fun _ -> AltStringAssert.StartsWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.StartsWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.DoesNotStartWith match1 @@ -461,12 +507,15 @@ module NUnit = AltStringAssert.AreEqualIgnoringCase match1 AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> - AltStringAssert.AreNotEqualIgnoringCase match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.AreNotEqualIgnoringCase match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.AreNotEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltStringAssert.AreNotEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -477,12 +526,15 @@ module NUnit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> - AltStringAssert.AreEqualIgnoringCase match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.AreEqualIgnoringCase match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.AreNotEqualIgnoringCase match1 @@ -509,11 +561,14 @@ module NUnit = AltFileAssert.AreEqual match1 AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match1) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -522,11 +577,14 @@ module NUnit = AltFileAssert.AreEqual match2 AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match2) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match2) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore use l2 = (File.OpenRead left) :> Stream @@ -538,11 +596,14 @@ module NUnit = AltFileAssert.AreEqual match3 AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match3) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match3) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -562,11 +623,12 @@ module NUnit = AltFileAssert.AreNotEqual match1 AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match1) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match1)) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -575,11 +637,12 @@ module NUnit = AltFileAssert.AreNotEqual match2 AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match2) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match2)) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore use l2 = (File.OpenRead left) :> Stream @@ -591,11 +654,12 @@ module NUnit = AltFileAssert.AreNotEqual match3 AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match3) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match3)) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -607,11 +671,15 @@ module NUnit = AltCollectionAssert.IsSubsetOf match1 AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsNotSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.IsNotSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -621,11 +689,15 @@ module NUnit = AltCollectionAssert.IsSupersetOf match2 AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsNotSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.IsNotSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -634,11 +706,14 @@ module NUnit = { Actual = [ B 5; B 1; B 2 ] Expected = [ B 1; B 5 ] } - Assert.Throws(fun _ -> AltCollectionAssert.IsSubsetOf match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSubsetOf match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltCollectionAssert.IsNotSubsetOf match1 @@ -648,11 +723,15 @@ module NUnit = { Actual = [ B 1; B 5 ] Expected = [ B 5; B 1; B 2 ] } - Assert.Throws(fun _ -> AltCollectionAssert.IsSupersetOf match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSupersetOf match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltCollectionAssert.IsNotSupersetOf match2 @@ -672,19 +751,26 @@ module NUnit = AltCollectionAssert.AreEqual(match1, excomp) AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.AreNotEqual match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, excomp)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, excomp)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -694,12 +780,15 @@ module NUnit = AltCollectionAssert.AreEquivalent match2 AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEquivalent match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEquivalent match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -713,19 +802,25 @@ module NUnit = AltCollectionAssert.AreNotEqual(match1, excomp) AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.AreEqual match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, excomp)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual(match1, excomp)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -735,9 +830,13 @@ module NUnit = AltCollectionAssert.AreNotEquivalent match2 AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.AreEquivalent match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEquivalent match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + Action(fun _ -> + AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore \ No newline at end of file diff --git a/altcode.test/validation/Xunit.fs b/altcode.test/validation/Xunit.fs index 3859252..46f0d67 100644 --- a/altcode.test/validation/Xunit.fs +++ b/altcode.test/validation/Xunit.fs @@ -32,22 +32,25 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> AltAssert.Contains match1) + Assert.Throws(Action(fun _ -> AltAssert.Contains match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Contains(match1, StringComparison.Ordinal)) + Assert.Throws( + Action(fun _ -> AltAssert.Contains(match1, StringComparison.Ordinal)) + ) |> ignore let match2 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(fun _ -> - AltAssert.DoesNotContain match2) + Assert.Throws( + Action(fun _ -> AltAssert.DoesNotContain match2) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.DoesNotContain(match2, StringComparison.Ordinal)) + Assert.Throws( + Action(fun _ -> AltAssert.DoesNotContain(match2, StringComparison.Ordinal)) + ) |> ignore [] @@ -62,7 +65,9 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "l" } - Assert.Throws(fun _ -> AltAssert.DoesNotMatch match1) + Assert.Throws( + Action(fun _ -> AltAssert.DoesNotMatch match1) + ) |> ignore [] @@ -78,11 +83,12 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltAssert.EndsWith match1) + Assert.Throws(Action(fun _ -> AltAssert.EndsWith match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.EndsWith(match1, StringComparison.Ordinal)) + Assert.Throws( + Action(fun _ -> AltAssert.EndsWith(match1, StringComparison.Ordinal)) + ) |> ignore let strcomp = @@ -104,19 +110,22 @@ module Xunit = { Actual = [ "Hello"; "World" ] Expected = [ "hello"; "world" ] } - Assert.Throws(fun _ -> - AltAssert.Equal match1) + Assert.Throws( + Action(fun _ -> AltAssert.Equal match1) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, strcomp)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, strcomp)) + ) |> ignore let func = Func(fun x y -> x.Equals y) - Assert.Throws(fun _ -> - AltAssert.Equal(match1, func)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, func)) + ) |> ignore let exrefcomp = @@ -145,18 +154,22 @@ module Xunit = let match1 = { Actual = A; Expected = C "hello" } - Assert.Throws(fun _ -> AltAssert.Equal match1) + Assert.Throws( + Action(fun _ -> AltAssert.Equal match1) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, exrefcomp)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, exrefcomp)) + ) |> ignore let func = Func<_, _, bool>(fun x y -> Object.ReferenceEquals(x, y)) - Assert.Throws(fun _ -> - AltAssert.Equal(match1, func)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, func)) + ) |> ignore [] @@ -183,26 +196,29 @@ module Xunit = let match1 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> AltAssert.Equal(match1, 2)) + Assert.Throws(Action(fun _ -> AltAssert.Equal(match1, 2))) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, 2, MidpointRounding.ToZero)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, 2, MidpointRounding.ToZero)) + ) |> ignore - Assert.Throws(fun _ -> AltAssert.Equal(match1, 0.1)) + Assert.Throws(Action(fun _ -> AltAssert.Equal(match1, 0.1))) |> ignore let match2 = { Actual = 5.0M; Expected = 6.0M } - Assert.Throws(fun _ -> AltAssert.Equal(match2, 2)) + Assert.Throws(Action(fun _ -> AltAssert.Equal(match2, 2))) |> ignore let match3 = { Actual = 5.0f; Expected = 6.0f } - Assert.Throws(fun _ -> AltAssert.Equal(match3, 0.1f)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match3, 0.1f)) + ) |> ignore [] @@ -222,8 +238,9 @@ module Xunit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> - AltAssert.Equal(match1, TimeSpan(1, 0, 0))) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, TimeSpan(1, 0, 0))) + ) |> ignore [] @@ -244,11 +261,12 @@ module Xunit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> AltAssert.Equal match1) + Assert.Throws(Action(fun _ -> AltAssert.Equal match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, false, false, false)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, false, false, false)) + ) |> ignore [] @@ -264,8 +282,9 @@ module Xunit = { Actual = A :> obj Expected = C "ulater" } - Assert.Throws(fun _ -> - AltAssert.Equivalent(match1, false)) + Assert.Throws( + Action(fun _ -> AltAssert.Equivalent(match1, false)) + ) |> ignore [] @@ -280,7 +299,7 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "x" } - Assert.Throws(fun _ -> AltAssert.Matches match1) + Assert.Throws(Action(fun _ -> AltAssert.Matches match1)) |> ignore [] @@ -299,19 +318,22 @@ module Xunit = { Actual = [ "Hello"; "World" ] Expected = [ "Hello"; "World" ] } - Assert.Throws(fun _ -> - AltAssert.NotEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, strcomp)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, strcomp)) + ) |> ignore let func = Func(fun x y -> x.Equals y) - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, func)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, func)) + ) |> ignore [] @@ -329,19 +351,22 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> - AltAssert.NotEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, exrefcomp)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, exrefcomp)) + ) |> ignore let func = Func<_, _, bool>(fun x y -> Object.ReferenceEquals(x, y)) - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, func)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, func)) + ) |> ignore [] @@ -361,12 +386,16 @@ module Xunit = let match1 = { Actual = 5.0; Expected = 5.0 } - Assert.Throws(fun _ -> AltAssert.NotEqual(match1, 2)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, 2)) + ) |> ignore let func = Func (=) - Assert.Throws(fun _ -> AltAssert.NotEqual(match1, func)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, func)) + ) |> ignore let doublecomp = @@ -380,14 +409,17 @@ module Xunit = AltAssert.Equal(hashmatch) - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, doublecomp)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, doublecomp)) + ) |> ignore let match2 = { Actual = 5.0M; Expected = 5.0M } - Assert.Throws(fun _ -> AltAssert.NotEqual(match2, 2)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match2, 2)) + ) |> ignore [] @@ -404,7 +436,7 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> AltAssert.NotSame match1) + Assert.Throws(Action(fun _ -> AltAssert.NotSame match1)) |> ignore [] @@ -420,8 +452,9 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> - AltAssert.NotStrictEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.NotStrictEqual match1) + ) |> ignore [] @@ -446,21 +479,24 @@ module Xunit = { Actual = HashSet [ 1; 2 ] Expected = HashSet [ 1 ] } - Assert.Throws(fun _ -> AltAssert.ProperSubset match1) + Assert.Throws( + Action(fun _ -> AltAssert.ProperSubset match1) + ) |> ignore - Assert.Throws(fun _ -> AltAssert.Subset match1) + Assert.Throws(Action(fun _ -> AltAssert.Subset match1)) |> ignore let match2 = { Actual = HashSet [ 1 ] Expected = HashSet [ 1; 2 ] } - Assert.Throws(fun _ -> - AltAssert.ProperSuperset match2) + Assert.Throws( + Action(fun _ -> AltAssert.ProperSuperset match2) + ) |> ignore - Assert.Throws(fun _ -> AltAssert.Superset match2) + Assert.Throws(Action(fun _ -> AltAssert.Superset match2)) |> ignore [] @@ -477,7 +513,7 @@ module Xunit = let match1 = { Actual = B 1; Expected = B 1 } - Assert.Throws(fun _ -> AltAssert.Same match1) + Assert.Throws(Action(fun _ -> AltAssert.Same match1)) |> ignore [] @@ -493,7 +529,9 @@ module Xunit = let StrictEqualItemsShouldFail () = let match1 = { Actual = B 1; Expected = A } - Assert.Throws(fun _ -> AltAssert.StrictEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.StrictEqual match1) + ) |> ignore [] @@ -509,9 +547,12 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(fun _ -> AltAssert.StartsWith match1) + Assert.Throws( + Action(fun _ -> AltAssert.StartsWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltAssert.StartsWith(match1, StringComparison.Ordinal)) + Assert.Throws( + Action(fun _ -> AltAssert.StartsWith(match1, StringComparison.Ordinal)) + ) |> ignore \ No newline at end of file