From 24c8c2eba17da7ee340e9e37159d3a75fb3f974f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 05:08:23 +0000 Subject: [PATCH 1/3] Bump NUnit from 4.5.1 to 4.6.0 --- updated-dependencies: - dependency-name: NUnit dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ - + From 196fda5bcc2d9aeadb8748f8493e502df7008213 Mon Sep 17 00:00:00 2001 From: SteveGilham Date: Mon, 4 May 2026 16:40:25 +0100 Subject: [PATCH 2/3] Addres API deprecations in NUnit 4.6.0 --- altcode.test/validation/Expecto.fs | 189 +++++++-------- altcode.test/validation/NUnit.fs | 354 +++++++++++++++++++---------- altcode.test/validation/Xunit.fs | 132 +++++------ 3 files changed, 397 insertions(+), 278 deletions(-) diff --git a/altcode.test/validation/Expecto.fs b/altcode.test/validation/Expecto.fs index bd1627e..9010d5e 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,44 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(fun _ -> AltExpect.containsAll match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.containsAll match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch1" match1) + Assert.Throws(new 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(new Action(fun _ -> AltExpect.containsAll match2 "match2")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch2" match2) + Assert.Throws(new 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(new Action(fun _ -> AltExpect.containsAll match3 "match3")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch3" match3) + Assert.Throws(new 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(new Action(fun _ -> AltExpect.containsAll match4 "match4")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.containsAll "flipmatch4" match4) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.containsAll "flipmatch4" match4)) |> ignore let diffPrinter a b = sprintf "%A.ne.%A" a b @@ -97,11 +98,11 @@ module Expecto = AltExpect.equalWithDiffPrinter diffPrinter match1 "match1" AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1 - Assert.Throws(fun _ -> AltExpect.notEqual match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.notEqual match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.notEqual "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.notEqual "flipmatch1" match1)) |> ignore [] @@ -110,19 +111,19 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(fun _ -> AltExpect.equal match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.equal match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.equal "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.equal "flipmatch1" match1)) |> ignore - Assert.Throws(fun _ -> - AltExpect.equalWithDiffPrinter diffPrinter match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.equalWithDiffPrinter diffPrinter match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1)) |> ignore AltExpect.notEqual match1 "match1" @@ -145,12 +146,12 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatClose accuracy match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.floatClose accuracy match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatClose "flipmatch1" accuracy match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.floatClose "flipmatch1" accuracy match1)) |> ignore [] @@ -166,12 +167,12 @@ module Expecto = let match1 = { Actual = -5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatGreaterThanOrClose accuracy match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.floatGreaterThanOrClose accuracy match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1)) |> ignore [] @@ -187,12 +188,12 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(fun _ -> - AltExpect.floatLessThanOrClose accuracy match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.floatLessThanOrClose accuracy match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1)) |> ignore let fast () = accuracy @@ -249,12 +250,12 @@ module Expecto = let match1 = { Actual = slow; Expected = fast } - Assert.Throws(fun _ -> - AltExpect.isFasterThan match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.isFasterThan match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isFasterThan "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isFasterThan "flipmatch1" match1)) |> ignore let fastfunc = @@ -296,12 +297,12 @@ module Expecto = { Actual = makeMeasurer slow Expected = makeMeasurer fast } - Assert.Throws(fun _ -> - AltExpect.isFasterThanSub match2 "match2") + Assert.Throws(new Action(fun _ -> + AltExpect.isFasterThanSub match2 "match2")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isFasterThanSub "flipmatch2" match2) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isFasterThanSub "flipmatch2" match2)) |> ignore [] @@ -318,20 +319,20 @@ module Expecto = let isGreaterThanOrEqualShouldFail () = let match1 = { Actual = -5; Expected = 3 } - Assert.Throws(fun _ -> - AltExpect.isGreaterThanOrEqual match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.isGreaterThanOrEqual match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1)) |> ignore - Assert.Throws(fun _ -> - AltExpect.isGreaterThan match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.isGreaterThan match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isGreaterThan "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isGreaterThan "flipmatch1" match1)) |> ignore [] @@ -348,19 +349,19 @@ module Expecto = let isLessThanOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 3 } - Assert.Throws(fun _ -> - AltExpect.isLessThanOrEqual match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.isLessThanOrEqual match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isLessThanOrEqual "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isLessThanOrEqual "flipmatch1" match1)) |> ignore - Assert.Throws(fun _ -> AltExpect.isLessThan match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.isLessThan match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isLessThan "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isLessThan "flipmatch1" match1)) |> ignore [] @@ -381,11 +382,11 @@ module Expecto = (fun x -> x |> Seq.exists (fun y -> y.Success)) match1 - Assert.Throws(fun _ -> AltExpect.isNotMatch match1 "match1b") + Assert.Throws(new Action(fun _ -> AltExpect.isNotMatch match1 "match1b")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isNotMatch "flipmatch1b" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isNotMatch "flipmatch1b" match1)) |> ignore [] @@ -393,25 +394,25 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "x" } - Assert.Throws(fun _ -> AltExpect.isMatch match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.isMatch match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.isMatch "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.isMatch "flipmatch1" match1)) |> ignore - Assert.Throws(fun _ -> + Assert.Throws(new Action(fun _ -> AltExpect.isMatchGroups match1 (fun x -> x |> Seq.exists (fun y -> y.Success)) - "match1a") + "match1a")) |> ignore - Assert.Throws(fun _ -> + Assert.Throws(new Action(fun _ -> AltFlipExpect.isMatchGroups "flipmatch1a" (fun x -> x |> Seq.exists (fun y -> y.Success)) - match1) + match1)) |> ignore AltExpect.isNotMatch match1 "match1b" @@ -430,12 +431,12 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws(fun _ -> - AltExpect.stringStarts match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.stringStarts match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringStarts "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.stringStarts "flipmatch1" match1)) |> ignore [] @@ -451,11 +452,11 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltExpect.stringEnds match1 "match1") + Assert.Throws(new Action(fun _ -> AltExpect.stringEnds match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringEnds "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.stringEnds "flipmatch1" match1)) |> ignore [] @@ -471,12 +472,12 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> - AltExpect.stringContains match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.stringContains match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.stringContains "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.stringContains "flipmatch1" match1)) |> ignore [] @@ -503,12 +504,12 @@ module Expecto = let match1 = { Actual = s1; Expected = s2 } - Assert.Throws(fun _ -> - AltExpect.streamsEqual match1 "match1") + Assert.Throws(new Action(fun _ -> + AltExpect.streamsEqual match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.streamsEqual "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.streamsEqual "flipmatch1" match1)) |> ignore [] @@ -526,12 +527,12 @@ 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(new Action(fun _ -> + AltExpect.sequenceEqual match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceEqual "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.sequenceEqual "flipmatch1" match1)) |> ignore [] @@ -549,12 +550,12 @@ 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(new Action(fun _ -> + AltExpect.sequenceStarts match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceStarts "flipmatch1" match1) + Assert.Throws(new Action(fun _ -> + AltFlipExpect.sequenceStarts "flipmatch1" match1)) |> ignore [] @@ -572,10 +573,10 @@ 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(new Action(fun _ -> + AltExpect.sequenceContainsOrder match1 "match1")) |> ignore - Assert.Throws(fun _ -> - AltFlipExpect.sequenceContainsOrder "flipmatch1" match1) + Assert.Throws(new 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..e7beaa6 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(new 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( + new 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(new Action(fun _ -> AltAssert.AreEqual match1)) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> AltAssert.AreEqual(match2, 0.1)) + Assert.Throws( + new 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( + new 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( + new Action(fun _ -> AltAssert.AreEqual(match4, 0.1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -112,13 +118,16 @@ module NUnit = let AreNotEqualShouldFail () = let match1 = { Actual = 5; Expected = 5 } - Assert.Throws(fun _ -> AltAssert.AreNotEqual match1) + Assert.Throws( + new 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( + new Action(fun _ -> AltAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -138,14 +147,15 @@ module NUnit = let match1 = { Actual = B 5; Expected = B 5 } - Assert.Throws(fun _ -> AltAssert.AreSame match1) + Assert.Throws(new 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( + new Action(fun _ -> AltAssert.AreSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -166,13 +176,16 @@ module NUnit = let match1 = { Actual = x; Expected = x } - Assert.Throws(fun _ -> AltAssert.AreNotSame match1) + Assert.Throws( + new 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( + new Action(fun _ -> AltAssert.AreNotSame(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -190,14 +203,15 @@ module NUnit = let GreaterShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> AltAssert.Greater match1) + Assert.Throws(new 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( + new Action(fun _ -> AltAssert.Greater(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -215,14 +229,17 @@ module NUnit = let GreaterOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(fun _ -> AltAssert.GreaterOrEqual match1) + Assert.Throws( + new 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( + new Action(fun _ -> AltAssert.GreaterOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -240,14 +257,15 @@ module NUnit = let LessShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws(fun _ -> AltAssert.Less match1) + Assert.Throws(new 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( + new Action(fun _ -> AltAssert.Less(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -265,14 +283,17 @@ module NUnit = let LessOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws(fun _ -> AltAssert.LessOrEqual match1) + Assert.Throws( + new 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( + new Action(fun _ -> AltAssert.LessOrEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -305,24 +326,32 @@ module NUnit = let match1 = (AssertionMatch.Create().WithActual d1).WithExpected d2 - Assert.Throws(fun _ -> AltDirectoryAssert.AreEqual match1) + Assert.Throws( + new 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( + new 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( + new 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( + new Action(fun _ -> + AltDirectoryAssert.AreNotEqual(match4, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -344,21 +373,28 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> AltStringAssert.Contains match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.Contains match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.Contains(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new 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( + new Action(fun _ -> AltStringAssert.DoesNotContain match2) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotContain(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.DoesNotContain(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -369,11 +405,14 @@ module NUnit = AltStringAssert.DoesNotMatch match1 AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.IsMatch match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.IsMatch match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.IsMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltStringAssert.IsMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -381,11 +420,15 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "l" } - Assert.Throws(fun _ -> AltStringAssert.DoesNotMatch match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.DoesNotMatch match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.IsMatch match1 @@ -399,11 +442,15 @@ module NUnit = AltStringAssert.EndsWith match1 AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.DoesNotEndWith match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.DoesNotEndWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotEndWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.DoesNotEndWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -411,11 +458,14 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltStringAssert.EndsWith match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.EndsWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.DoesNotEndWith match1 @@ -429,11 +479,15 @@ module NUnit = AltStringAssert.StartsWith match1 AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltStringAssert.DoesNotStartWith match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.DoesNotStartWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.DoesNotStartWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.DoesNotStartWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -441,11 +495,14 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws(fun _ -> AltStringAssert.StartsWith match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.StartsWith match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.DoesNotStartWith match1 @@ -461,12 +518,15 @@ module NUnit = AltStringAssert.AreEqualIgnoringCase match1 AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> - AltStringAssert.AreNotEqualIgnoringCase match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.AreNotEqualIgnoringCase match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.AreNotEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.AreNotEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -477,12 +537,15 @@ module NUnit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> - AltStringAssert.AreEqualIgnoringCase match1) + Assert.Throws( + new Action(fun _ -> AltStringAssert.AreEqualIgnoringCase match1) + ) |> ignore - Assert.Throws(fun _ -> - AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltStringAssert.AreNotEqualIgnoringCase match1 @@ -509,11 +572,14 @@ module NUnit = AltFileAssert.AreEqual match1 AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match1) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -522,11 +588,14 @@ module NUnit = AltFileAssert.AreEqual match2 AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match2) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual match2) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore use l2 = (File.OpenRead left) :> Stream @@ -538,11 +607,14 @@ module NUnit = AltFileAssert.AreEqual match3 AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreNotEqual match3) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual match3) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -562,11 +634,14 @@ module NUnit = AltFileAssert.AreNotEqual match1 AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match1) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -575,11 +650,14 @@ module NUnit = AltFileAssert.AreNotEqual match2 AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match2) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual match2) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore use l2 = (File.OpenRead left) :> Stream @@ -591,11 +669,14 @@ module NUnit = AltFileAssert.AreNotEqual match3 AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltFileAssert.AreEqual match3) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual match3) + ) |> ignore - Assert.Throws(fun _ -> - AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -607,11 +688,15 @@ module NUnit = AltCollectionAssert.IsSubsetOf match1 AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsNotSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.IsNotSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -621,11 +706,15 @@ module NUnit = AltCollectionAssert.IsSupersetOf match2 AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsNotSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.IsNotSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -634,11 +723,15 @@ module NUnit = { Actual = [ B 5; B 1; B 2 ] Expected = [ B 1; B 5 ] } - Assert.Throws(fun _ -> AltCollectionAssert.IsSubsetOf match1) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.IsSubsetOf match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltCollectionAssert.IsNotSubsetOf match1 @@ -648,11 +741,15 @@ module NUnit = { Actual = [ B 1; B 5 ] Expected = [ B 5; B 1; B 2 ] } - Assert.Throws(fun _ -> AltCollectionAssert.IsSupersetOf match2) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.IsSupersetOf match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore AltCollectionAssert.IsNotSupersetOf match2 @@ -672,19 +769,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( + new Action(fun _ -> AltCollectionAssert.AreNotEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, excomp)) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, excomp)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -694,12 +798,15 @@ module NUnit = AltCollectionAssert.AreEquivalent match2 AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEquivalent match2) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.AreNotEquivalent match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore [] @@ -713,19 +820,26 @@ 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( + new Action(fun _ -> AltCollectionAssert.AreEqual match1) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, excomp)) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.AreEqual(match1, excomp)) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new Action(fun _ -> + AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) + ) |> ignore let match2 = @@ -735,9 +849,13 @@ module NUnit = AltCollectionAssert.AreNotEquivalent match2 AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws(fun _ -> AltCollectionAssert.AreEquivalent match2) + Assert.Throws( + new Action(fun _ -> AltCollectionAssert.AreEquivalent match2) + ) |> ignore - Assert.Throws(fun _ -> - AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) + Assert.Throws( + new 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..c46966e 100644 --- a/altcode.test/validation/Xunit.fs +++ b/altcode.test/validation/Xunit.fs @@ -32,22 +32,22 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(fun _ -> AltAssert.Contains match1) + Assert.Throws(new Action(fun _ -> AltAssert.Contains match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Contains(match1, StringComparison.Ordinal)) + Assert.Throws(new Action(fun _ -> + AltAssert.Contains(match1, StringComparison.Ordinal))) |> ignore let match2 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(fun _ -> - AltAssert.DoesNotContain match2) + Assert.Throws(new Action(fun _ -> + AltAssert.DoesNotContain match2)) |> ignore - Assert.Throws(fun _ -> - AltAssert.DoesNotContain(match2, StringComparison.Ordinal)) + Assert.Throws(new Action(fun _ -> + AltAssert.DoesNotContain(match2, StringComparison.Ordinal))) |> ignore [] @@ -62,7 +62,7 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "l" } - Assert.Throws(fun _ -> AltAssert.DoesNotMatch match1) + Assert.Throws(new Action(fun _ -> AltAssert.DoesNotMatch match1)) |> ignore [] @@ -78,11 +78,11 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(fun _ -> AltAssert.EndsWith match1) + Assert.Throws(new Action(fun _ -> AltAssert.EndsWith match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.EndsWith(match1, StringComparison.Ordinal)) + Assert.Throws(new Action(fun _ -> + AltAssert.EndsWith(match1, StringComparison.Ordinal))) |> ignore let strcomp = @@ -104,19 +104,19 @@ module Xunit = { Actual = [ "Hello"; "World" ] Expected = [ "hello"; "world" ] } - Assert.Throws(fun _ -> - AltAssert.Equal match1) + Assert.Throws(new Action(fun _ -> + AltAssert.Equal match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, strcomp)) + Assert.Throws(new 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(new Action(fun _ -> + AltAssert.Equal(match1, func))) |> ignore let exrefcomp = @@ -145,18 +145,18 @@ module Xunit = let match1 = { Actual = A; Expected = C "hello" } - Assert.Throws(fun _ -> AltAssert.Equal match1) + Assert.Throws(new Action(fun _ -> AltAssert.Equal match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, exrefcomp)) + Assert.Throws(new 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(new Action(fun _ -> + AltAssert.Equal(match1, func))) |> ignore [] @@ -183,26 +183,26 @@ module Xunit = let match1 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws(fun _ -> AltAssert.Equal(match1, 2)) + Assert.Throws(new Action(fun _ -> AltAssert.Equal(match1, 2))) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, 2, MidpointRounding.ToZero)) + Assert.Throws(new Action(fun _ -> + AltAssert.Equal(match1, 2, MidpointRounding.ToZero))) |> ignore - Assert.Throws(fun _ -> AltAssert.Equal(match1, 0.1)) + Assert.Throws(new 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(new 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(new Action(fun _ -> AltAssert.Equal(match3, 0.1f))) |> ignore [] @@ -222,8 +222,8 @@ module Xunit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> - AltAssert.Equal(match1, TimeSpan(1, 0, 0))) + Assert.Throws(new Action(fun _ -> + AltAssert.Equal(match1, TimeSpan(1, 0, 0)))) |> ignore [] @@ -244,11 +244,11 @@ module Xunit = let match1 = { Actual = item; Expected = later } - Assert.Throws(fun _ -> AltAssert.Equal match1) + Assert.Throws(new Action(fun _ -> AltAssert.Equal match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.Equal(match1, false, false, false)) + Assert.Throws(new Action(fun _ -> + AltAssert.Equal(match1, false, false, false))) |> ignore [] @@ -264,8 +264,8 @@ module Xunit = { Actual = A :> obj Expected = C "ulater" } - Assert.Throws(fun _ -> - AltAssert.Equivalent(match1, false)) + Assert.Throws(new Action(fun _ -> + AltAssert.Equivalent(match1, false))) |> ignore [] @@ -280,7 +280,7 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "x" } - Assert.Throws(fun _ -> AltAssert.Matches match1) + Assert.Throws(new Action(fun _ -> AltAssert.Matches match1)) |> ignore [] @@ -299,19 +299,19 @@ module Xunit = { Actual = [ "Hello"; "World" ] Expected = [ "Hello"; "World" ] } - Assert.Throws(fun _ -> - AltAssert.NotEqual match1) + Assert.Throws(new Action(fun _ -> + AltAssert.NotEqual match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, strcomp)) + Assert.Throws(new 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(new Action(fun _ -> + AltAssert.NotEqual(match1, func))) |> ignore [] @@ -329,19 +329,19 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> - AltAssert.NotEqual match1) + Assert.Throws(new Action(fun _ -> + AltAssert.NotEqual match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, exrefcomp)) + Assert.Throws(new 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(new Action(fun _ -> + AltAssert.NotEqual(match1, func))) |> ignore [] @@ -361,12 +361,12 @@ module Xunit = let match1 = { Actual = 5.0; Expected = 5.0 } - Assert.Throws(fun _ -> AltAssert.NotEqual(match1, 2)) + Assert.Throws(new Action(fun _ -> AltAssert.NotEqual(match1, 2))) |> ignore let func = Func (=) - Assert.Throws(fun _ -> AltAssert.NotEqual(match1, func)) + Assert.Throws(new Action(fun _ -> AltAssert.NotEqual(match1, func))) |> ignore let doublecomp = @@ -380,14 +380,14 @@ module Xunit = AltAssert.Equal(hashmatch) - Assert.Throws(fun _ -> - AltAssert.NotEqual(match1, doublecomp)) + Assert.Throws(new Action(fun _ -> + AltAssert.NotEqual(match1, doublecomp))) |> ignore let match2 = { Actual = 5.0M; Expected = 5.0M } - Assert.Throws(fun _ -> AltAssert.NotEqual(match2, 2)) + Assert.Throws(new Action(fun _ -> AltAssert.NotEqual(match2, 2))) |> ignore [] @@ -404,7 +404,7 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> AltAssert.NotSame match1) + Assert.Throws(new Action(fun _ -> AltAssert.NotSame match1)) |> ignore [] @@ -420,8 +420,8 @@ module Xunit = let match1 = (AssertionMatch.Create().WithActual item).WithExpected item - Assert.Throws(fun _ -> - AltAssert.NotStrictEqual match1) + Assert.Throws(new Action(fun _ -> + AltAssert.NotStrictEqual match1)) |> ignore [] @@ -446,21 +446,21 @@ module Xunit = { Actual = HashSet [ 1; 2 ] Expected = HashSet [ 1 ] } - Assert.Throws(fun _ -> AltAssert.ProperSubset match1) + Assert.Throws(new Action(fun _ -> AltAssert.ProperSubset match1)) |> ignore - Assert.Throws(fun _ -> AltAssert.Subset match1) + Assert.Throws(new Action(fun _ -> AltAssert.Subset match1)) |> ignore let match2 = { Actual = HashSet [ 1 ] Expected = HashSet [ 1; 2 ] } - Assert.Throws(fun _ -> - AltAssert.ProperSuperset match2) + Assert.Throws(new Action(fun _ -> + AltAssert.ProperSuperset match2)) |> ignore - Assert.Throws(fun _ -> AltAssert.Superset match2) + Assert.Throws(new Action(fun _ -> AltAssert.Superset match2)) |> ignore [] @@ -477,7 +477,7 @@ module Xunit = let match1 = { Actual = B 1; Expected = B 1 } - Assert.Throws(fun _ -> AltAssert.Same match1) + Assert.Throws(new Action(fun _ -> AltAssert.Same match1)) |> ignore [] @@ -493,7 +493,7 @@ module Xunit = let StrictEqualItemsShouldFail () = let match1 = { Actual = B 1; Expected = A } - Assert.Throws(fun _ -> AltAssert.StrictEqual match1) + Assert.Throws(new Action(fun _ -> AltAssert.StrictEqual match1)) |> ignore [] @@ -509,9 +509,9 @@ module Xunit = let match1 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(fun _ -> AltAssert.StartsWith match1) + Assert.Throws(new Action(fun _ -> AltAssert.StartsWith match1)) |> ignore - Assert.Throws(fun _ -> - AltAssert.StartsWith(match1, StringComparison.Ordinal)) + Assert.Throws(new Action(fun _ -> + AltAssert.StartsWith(match1, StringComparison.Ordinal))) |> ignore \ No newline at end of file From 9edd2d1bd37c00b02ce2af53201883581a1dadaf Mon Sep 17 00:00:00 2001 From: SteveGilham Date: Mon, 4 May 2026 16:56:40 +0100 Subject: [PATCH 3/3] Fix cut&paste errors --- altcode.test/validation/Expecto.fs | 264 +++++++++++++++---------- altcode.test/validation/NUnit.fs | 301 ++++++++++++++--------------- altcode.test/validation/Xunit.fs | 173 ++++++++++------- 3 files changed, 412 insertions(+), 326 deletions(-) diff --git a/altcode.test/validation/Expecto.fs b/altcode.test/validation/Expecto.fs index 9010d5e..f03eed9 100644 --- a/altcode.test/validation/Expecto.fs +++ b/altcode.test/validation/Expecto.fs @@ -46,44 +46,56 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(new Action(fun _ -> AltExpect.containsAll match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match1 "match1") + ) |> ignore - Assert.Throws(new Action(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(new Action(fun _ -> AltExpect.containsAll match2 "match2")) + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match2 "match2") + ) |> ignore - Assert.Throws(new Action(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(new Action(fun _ -> AltExpect.containsAll match3 "match3")) + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match3 "match3") + ) |> ignore - Assert.Throws(new Action(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(new Action(fun _ -> AltExpect.containsAll match4 "match4")) + Assert.Throws( + Action(fun _ -> AltExpect.containsAll match4 "match4") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.containsAll "flipmatch4" match4)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.containsAll "flipmatch4" match4) + ) |> ignore let diffPrinter a b = sprintf "%A.ne.%A" a b @@ -98,11 +110,14 @@ module Expecto = AltExpect.equalWithDiffPrinter diffPrinter match1 "match1" AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1 - Assert.Throws(new Action(fun _ -> AltExpect.notEqual match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.notEqual match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.notEqual "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.notEqual "flipmatch1" match1) + ) |> ignore [] @@ -111,19 +126,24 @@ module Expecto = { Actual = [ 1; 2; 3 ] Expected = [ 1; 4 ] } - Assert.Throws(new Action(fun _ -> AltExpect.equal match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.equal match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.equal "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.equal "flipmatch1" match1) + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltExpect.equalWithDiffPrinter diffPrinter match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.equalWithDiffPrinter diffPrinter match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.equalWithDiffPrinter diffPrinter "flipmatch1" match1) + ) |> ignore AltExpect.notEqual match1 "match1" @@ -146,12 +166,14 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(new Action(fun _ -> - AltExpect.floatClose accuracy match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.floatClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.floatClose "flipmatch1" accuracy match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatClose "flipmatch1" accuracy match1) + ) |> ignore [] @@ -167,12 +189,14 @@ module Expecto = let match1 = { Actual = -5.0; Expected = 3.0 } - Assert.Throws(new Action(fun _ -> - AltExpect.floatGreaterThanOrClose accuracy match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.floatGreaterThanOrClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatGreaterThanOrClose "flipmatch1" accuracy match1) + ) |> ignore [] @@ -188,12 +212,14 @@ module Expecto = let match1 = { Actual = 5.0; Expected = 3.0 } - Assert.Throws(new Action(fun _ -> - AltExpect.floatLessThanOrClose accuracy match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.floatLessThanOrClose accuracy match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.floatLessThanOrClose "flipmatch1" accuracy match1) + ) |> ignore let fast () = accuracy @@ -250,12 +276,14 @@ module Expecto = let match1 = { Actual = slow; Expected = fast } - Assert.Throws(new Action(fun _ -> - AltExpect.isFasterThan match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isFasterThan match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isFasterThan "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isFasterThan "flipmatch1" match1) + ) |> ignore let fastfunc = @@ -297,12 +325,14 @@ module Expecto = { Actual = makeMeasurer slow Expected = makeMeasurer fast } - Assert.Throws(new Action(fun _ -> - AltExpect.isFasterThanSub match2 "match2")) + Assert.Throws( + Action(fun _ -> AltExpect.isFasterThanSub match2 "match2") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isFasterThanSub "flipmatch2" match2)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isFasterThanSub "flipmatch2" match2) + ) |> ignore [] @@ -319,20 +349,24 @@ module Expecto = let isGreaterThanOrEqualShouldFail () = let match1 = { Actual = -5; Expected = 3 } - Assert.Throws(new Action(fun _ -> - AltExpect.isGreaterThanOrEqual match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isGreaterThanOrEqual match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isGreaterThanOrEqual "flipmatch1" match1) + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltExpect.isGreaterThan match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isGreaterThan match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isGreaterThan "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isGreaterThan "flipmatch1" match1) + ) |> ignore [] @@ -349,19 +383,24 @@ module Expecto = let isLessThanOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 3 } - Assert.Throws(new Action(fun _ -> - AltExpect.isLessThanOrEqual match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isLessThanOrEqual match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isLessThanOrEqual "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isLessThanOrEqual "flipmatch1" match1) + ) |> ignore - Assert.Throws(new Action(fun _ -> AltExpect.isLessThan match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isLessThan match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isLessThan "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isLessThan "flipmatch1" match1) + ) |> ignore [] @@ -382,11 +421,14 @@ module Expecto = (fun x -> x |> Seq.exists (fun y -> y.Success)) match1 - Assert.Throws(new Action(fun _ -> AltExpect.isNotMatch match1 "match1b")) + Assert.Throws( + Action(fun _ -> AltExpect.isNotMatch match1 "match1b") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isNotMatch "flipmatch1b" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isNotMatch "flipmatch1b" match1) + ) |> ignore [] @@ -394,25 +436,32 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "x" } - Assert.Throws(new Action(fun _ -> AltExpect.isMatch match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.isMatch match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.isMatch "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.isMatch "flipmatch1" match1) + ) |> ignore - Assert.Throws(new Action(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(new Action(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" @@ -431,12 +480,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws(new Action(fun _ -> - AltExpect.stringStarts match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.stringStarts match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.stringStarts "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringStarts "flipmatch1" match1) + ) |> ignore [] @@ -452,11 +503,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws(new Action(fun _ -> AltExpect.stringEnds match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.stringEnds match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.stringEnds "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringEnds "flipmatch1" match1) + ) |> ignore [] @@ -472,12 +526,14 @@ module Expecto = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws(new Action(fun _ -> - AltExpect.stringContains match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.stringContains match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.stringContains "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.stringContains "flipmatch1" match1) + ) |> ignore [] @@ -504,12 +560,14 @@ module Expecto = let match1 = { Actual = s1; Expected = s2 } - Assert.Throws(new Action(fun _ -> - AltExpect.streamsEqual match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.streamsEqual match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.streamsEqual "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.streamsEqual "flipmatch1" match1) + ) |> ignore [] @@ -527,12 +585,14 @@ module Expecto = { Actual = [ B 5; B 1; B 2 ] Expected = [ B 1; B 5; B 3 ] } - Assert.Throws(new Action(fun _ -> - AltExpect.sequenceEqual match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.sequenceEqual match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.sequenceEqual "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.sequenceEqual "flipmatch1" match1) + ) |> ignore [] @@ -550,12 +610,14 @@ module Expecto = { Actual = [ B 5; B 1; B 2; B 3 ] Expected = [ B 1; B 5 ] } - Assert.Throws(new Action(fun _ -> - AltExpect.sequenceStarts match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.sequenceStarts match1 "match1") + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltFlipExpect.sequenceStarts "flipmatch1" match1)) + Assert.Throws( + Action(fun _ -> AltFlipExpect.sequenceStarts "flipmatch1" match1) + ) |> ignore [] @@ -573,10 +635,12 @@ module Expecto = { Actual = [ B 5; B 1; B 2; B 3 ] Expected = [ B 1; B 5 ] } - Assert.Throws(new Action(fun _ -> - AltExpect.sequenceContainsOrder match1 "match1")) + Assert.Throws( + Action(fun _ -> AltExpect.sequenceContainsOrder match1 "match1") + ) |> ignore - Assert.Throws(new Action(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 e7beaa6..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(new Action(fun _ -> AltAssert.That match1)) + Assert.Throws(Action(fun _ -> AltAssert.That match1)) let expected = """ Assert.That(, ) @@ -41,8 +41,8 @@ module NUnit = (Constraint.Create().WithActual true).WithConstraint Is.Not.True let x2 = - Assert.Throws( - new Action(fun _ -> AltAssert.That(match2, "some text")) + Assert.Throws( + Action(fun _ -> AltAssert.That(match2, "some text")) ) let expected2 = @@ -78,29 +78,29 @@ module NUnit = let AreEqualShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(new Action(fun _ -> AltAssert.AreEqual match1)) + Assert.Throws(Action(fun _ -> AltAssert.AreEqual match1)) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws( - new Action(fun _ -> AltAssert.AreEqual(match2, 0.1)) + Assert.Throws( + Action(fun _ -> AltAssert.AreEqual(match2, 0.1)) ) |> ignore let match3 = { Actual = 5; Expected = 6 } - Assert.Throws( - new Action(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( - new Action(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 @@ -118,15 +118,13 @@ module NUnit = let AreNotEqualShouldFail () = let match1 = { Actual = 5; Expected = 5 } - Assert.Throws( - new Action(fun _ -> AltAssert.AreNotEqual match1) - ) + Assert.Throws(Action(fun _ -> AltAssert.AreNotEqual match1)) |> ignore let match3 = { Actual = 5; Expected = 5 } - Assert.Throws( - new Action(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 @@ -147,14 +145,14 @@ module NUnit = let match1 = { Actual = B 5; Expected = B 5 } - Assert.Throws(new Action(fun _ -> AltAssert.AreSame match1)) + Assert.Throws(Action(fun _ -> AltAssert.AreSame match1)) |> ignore let match3 = { Actual = A; Expected = C "6" } - Assert.Throws( - new Action(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 @@ -176,15 +174,13 @@ module NUnit = let match1 = { Actual = x; Expected = x } - Assert.Throws( - new Action(fun _ -> AltAssert.AreNotSame match1) - ) + Assert.Throws(Action(fun _ -> AltAssert.AreNotSame match1)) |> ignore let match3 = { Actual = A; Expected = A } - Assert.Throws( - new Action(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 @@ -203,14 +199,14 @@ module NUnit = let GreaterShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws(new Action(fun _ -> AltAssert.Greater match1)) + Assert.Throws(Action(fun _ -> AltAssert.Greater match1)) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws( - new Action(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 @@ -229,16 +225,16 @@ module NUnit = let GreaterOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 6 } - Assert.Throws( - new Action(fun _ -> AltAssert.GreaterOrEqual match1) + Assert.Throws( + Action(fun _ -> AltAssert.GreaterOrEqual match1) ) |> ignore let match2 = { Actual = 5.0; Expected = 6.0 } - Assert.Throws( - new Action(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 @@ -257,14 +253,14 @@ module NUnit = let LessShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws(new Action(fun _ -> AltAssert.Less match1)) + Assert.Throws(Action(fun _ -> AltAssert.Less match1)) |> ignore let match2 = { Actual = 5.0; Expected = 4.0 } - Assert.Throws( - new Action(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 @@ -283,16 +279,14 @@ module NUnit = let LessOrEqualShouldFail () = let match1 = { Actual = 5; Expected = 4 } - Assert.Throws( - new Action(fun _ -> AltAssert.LessOrEqual match1) - ) + Assert.Throws(Action(fun _ -> AltAssert.LessOrEqual match1)) |> ignore let match2 = { Actual = 5.0; Expected = 4.0 } - Assert.Throws( - new Action(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 @@ -326,31 +320,29 @@ module NUnit = let match1 = (AssertionMatch.Create().WithActual d1).WithExpected d2 - Assert.Throws( - new Action(fun _ -> AltDirectoryAssert.AreEqual match1) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreEqual match1) ) |> ignore let match2 = { Actual = d2; Expected = d1 } - Assert.Throws( - new Action(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( - new Action(fun _ -> AltDirectoryAssert.AreNotEqual match3) + Assert.Throws( + Action(fun _ -> AltDirectoryAssert.AreNotEqual match3) ) |> ignore let match4 = { Actual = d2; Expected = d2 } - Assert.Throws( - new Action(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 @@ -373,27 +365,26 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "?" } - Assert.Throws( - new Action(fun _ -> AltStringAssert.Contains match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.Contains match1) ) |> ignore - Assert.Throws( - new Action(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( - new Action(fun _ -> AltStringAssert.DoesNotContain match2) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotContain match2) ) |> ignore - Assert.Throws( - new Action(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 @@ -405,13 +396,13 @@ module NUnit = AltStringAssert.DoesNotMatch match1 AltStringAssert.DoesNotMatch(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltStringAssert.IsMatch match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.IsMatch match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -420,14 +411,13 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "l" } - Assert.Throws( - new Action(fun _ -> AltStringAssert.DoesNotMatch match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotMatch match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -442,14 +432,13 @@ module NUnit = AltStringAssert.EndsWith match1 AltStringAssert.EndsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltStringAssert.DoesNotEndWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotEndWith match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -458,13 +447,13 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "H" } - Assert.Throws( - new Action(fun _ -> AltStringAssert.EndsWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.EndsWith match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -479,13 +468,13 @@ module NUnit = AltStringAssert.StartsWith match1 AltStringAssert.StartsWith(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltStringAssert.DoesNotStartWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotStartWith match1) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltStringAssert.DoesNotStartWith(match1, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -495,13 +484,13 @@ module NUnit = let match1 = { Actual = "Hello"; Expected = "o" } - Assert.Throws( - new Action(fun _ -> AltStringAssert.StartsWith match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.StartsWith match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -518,13 +507,13 @@ module NUnit = AltStringAssert.AreEqualIgnoringCase match1 AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltStringAssert.AreNotEqualIgnoringCase match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.AreNotEqualIgnoringCase match1) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltStringAssert.AreNotEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -537,13 +526,13 @@ module NUnit = let match1 = { Actual = item; Expected = later } - Assert.Throws( - new Action(fun _ -> AltStringAssert.AreEqualIgnoringCase match1) + Assert.Throws( + Action(fun _ -> AltStringAssert.AreEqualIgnoringCase match1) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltStringAssert.AreEqualIgnoringCase(match1, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -572,13 +561,13 @@ module NUnit = AltFileAssert.AreEqual match1 AltFileAssert.AreEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreNotEqual match1) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -588,13 +577,13 @@ module NUnit = AltFileAssert.AreEqual match2 AltFileAssert.AreEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreNotEqual match2) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match2) ) |> ignore - Assert.Throws( - new Action(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 @@ -607,13 +596,13 @@ module NUnit = AltFileAssert.AreEqual match3 AltFileAssert.AreEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreNotEqual match3) + Assert.Throws( + Action(fun _ -> AltFileAssert.AreNotEqual match3) ) |> ignore - Assert.Throws( - new Action(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 @@ -634,13 +623,11 @@ module NUnit = AltFileAssert.AreNotEqual match1 AltFileAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreEqual match1) - ) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match1)) |> ignore - Assert.Throws( - new Action(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 @@ -650,13 +637,11 @@ module NUnit = AltFileAssert.AreNotEqual match2 AltFileAssert.AreNotEqual(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreEqual match2) - ) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match2)) |> ignore - Assert.Throws( - new Action(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 @@ -669,13 +654,11 @@ module NUnit = AltFileAssert.AreNotEqual match3 AltFileAssert.AreNotEqual(match3, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltFileAssert.AreEqual match3) - ) + Assert.Throws(Action(fun _ -> AltFileAssert.AreEqual match3)) |> ignore - Assert.Throws( - new Action(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 @@ -688,13 +671,13 @@ module NUnit = AltCollectionAssert.IsSubsetOf match1 AltCollectionAssert.IsSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSubsetOf match1) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSubsetOf(match1, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -706,13 +689,13 @@ module NUnit = AltCollectionAssert.IsSupersetOf match2 AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSupersetOf match2) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsNotSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -723,14 +706,13 @@ module NUnit = { Actual = [ B 5; B 1; B 2 ] Expected = [ B 1; B 5 ] } - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.IsSubsetOf match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSubsetOf match1) ) |> ignore - Assert.Throws( - new Action(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 @@ -741,13 +723,13 @@ module NUnit = { Actual = [ B 1; B 5 ] Expected = [ B 5; B 1; B 2 ] } - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.IsSupersetOf match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSupersetOf match2) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.IsSupersetOf(match2, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -769,24 +751,24 @@ module NUnit = AltCollectionAssert.AreEqual(match1, excomp) AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.AreNotEqual match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual match1) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, excomp)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, excomp)) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -798,13 +780,13 @@ module NUnit = AltCollectionAssert.AreEquivalent match2 AltCollectionAssert.AreEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.AreNotEquivalent match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEquivalent match2) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -820,24 +802,23 @@ module NUnit = AltCollectionAssert.AreNotEqual(match1, excomp) AltCollectionAssert.AreNotEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.AreEqual match1) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual match1) ) |> ignore - Assert.Throws( - new Action(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( - new Action(fun _ -> AltCollectionAssert.AreEqual(match1, excomp)) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual(match1, excomp)) ) |> ignore - Assert.Throws( - new Action(fun _ -> + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEqual(match1, excomp, "bang {0} {2}", 1, 2., 3, 4)) ) |> ignore @@ -849,13 +830,13 @@ module NUnit = AltCollectionAssert.AreNotEquivalent match2 AltCollectionAssert.AreNotEquivalent(match2, "bang {0} {2}", 1, 2., 3, 4) - Assert.Throws( - new Action(fun _ -> AltCollectionAssert.AreEquivalent match2) + Assert.Throws( + Action(fun _ -> AltCollectionAssert.AreEquivalent match2) ) |> ignore - Assert.Throws( - new Action(fun _ -> + 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 c46966e..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(new Action(fun _ -> AltAssert.Contains match1)) + Assert.Throws(Action(fun _ -> AltAssert.Contains match1)) |> ignore - Assert.Throws(new Action(fun _ -> - AltAssert.Contains(match1, StringComparison.Ordinal))) + Assert.Throws( + Action(fun _ -> AltAssert.Contains(match1, StringComparison.Ordinal)) + ) |> ignore let match2 = { Actual = "Hello"; Expected = "e" } - Assert.Throws(new Action(fun _ -> - AltAssert.DoesNotContain match2)) + Assert.Throws( + Action(fun _ -> AltAssert.DoesNotContain match2) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> AltAssert.EndsWith match1)) + Assert.Throws(Action(fun _ -> AltAssert.EndsWith match1)) |> ignore - Assert.Throws(new Action(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(new Action(fun _ -> - AltAssert.Equal match1)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal match1) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> AltAssert.Equal match1)) + Assert.Throws( + Action(fun _ -> AltAssert.Equal match1) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> AltAssert.Equal(match1, 2))) + Assert.Throws(Action(fun _ -> AltAssert.Equal(match1, 2))) |> ignore - Assert.Throws(new Action(fun _ -> - AltAssert.Equal(match1, 2, MidpointRounding.ToZero))) + Assert.Throws( + Action(fun _ -> AltAssert.Equal(match1, 2, MidpointRounding.ToZero)) + ) |> ignore - Assert.Throws(new Action(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(new Action(fun _ -> AltAssert.Equal(match2, 2))) + Assert.Throws(Action(fun _ -> AltAssert.Equal(match2, 2))) |> ignore let match3 = { Actual = 5.0f; Expected = 6.0f } - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> AltAssert.Equal match1)) + Assert.Throws(Action(fun _ -> AltAssert.Equal match1)) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(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(new Action(fun _ -> - AltAssert.NotEqual match1)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual match1) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> - AltAssert.NotEqual match1)) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual match1) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(fun _ -> AltAssert.NotEqual(match1, 2))) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, 2)) + ) |> ignore let func = Func (=) - Assert.Throws(new Action(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(new Action(fun _ -> - AltAssert.NotEqual(match1, doublecomp))) + Assert.Throws( + Action(fun _ -> AltAssert.NotEqual(match1, doublecomp)) + ) |> ignore let match2 = { Actual = 5.0M; Expected = 5.0M } - Assert.Throws(new Action(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(new Action(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(new Action(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(new Action(fun _ -> AltAssert.ProperSubset match1)) + Assert.Throws( + Action(fun _ -> AltAssert.ProperSubset match1) + ) |> ignore - Assert.Throws(new Action(fun _ -> AltAssert.Subset match1)) + Assert.Throws(Action(fun _ -> AltAssert.Subset match1)) |> ignore let match2 = { Actual = HashSet [ 1 ] Expected = HashSet [ 1; 2 ] } - Assert.Throws(new Action(fun _ -> - AltAssert.ProperSuperset match2)) + Assert.Throws( + Action(fun _ -> AltAssert.ProperSuperset match2) + ) |> ignore - Assert.Throws(new Action(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(new Action(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(new Action(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(new Action(fun _ -> AltAssert.StartsWith match1)) + Assert.Throws( + Action(fun _ -> AltAssert.StartsWith match1) + ) |> ignore - Assert.Throws(new Action(fun _ -> - AltAssert.StartsWith(match1, StringComparison.Ordinal))) + Assert.Throws( + Action(fun _ -> AltAssert.StartsWith(match1, StringComparison.Ordinal)) + ) |> ignore \ No newline at end of file