diff --git a/TUnit.Assertions.Tests/IntAssertionTests.cs b/TUnit.Assertions.Tests/IntAssertionTests.cs new file mode 100644 index 0000000000..a56dd4a942 --- /dev/null +++ b/TUnit.Assertions.Tests/IntAssertionTests.cs @@ -0,0 +1,103 @@ +using TUnit.Assertions.Extensions; + +namespace TUnit.Assertions.Tests; + +public class IntAssertionTests +{ + [Test] + public async Task Test_Int_IsZero() + { + var value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Int_IsZero_Literal() + { + await Assert.That(0).IsZero(); + } + + [Test] + public async Task Test_Int_IsZero_Fails_WhenNotZero() + { + var value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Int_IsNotZero_Positive() + { + var value = 1; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Int_IsNotZero_Negative() + { + var value = -1; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Int_IsNotZero_Large() + { + var value = 1000000; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Int_IsNotZero_Fails_WhenZero() + { + var value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Int_IsEven_Zero() + { + var value = 0; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Int_IsEven_Positive() + { + var value = 2; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Int_IsEven_Negative() + { + var value = -4; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Int_IsEven_Fails_WhenOdd() + { + var value = 3; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Int_IsOdd_Positive() + { + var value = 3; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Int_IsOdd_Negative() + { + var value = -5; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Int_IsOdd_Fails_WhenEven() + { + var value = 4; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } +} diff --git a/TUnit.Assertions.Tests/NumericAssertionTests.cs b/TUnit.Assertions.Tests/NumericAssertionTests.cs new file mode 100644 index 0000000000..75736bfbd3 --- /dev/null +++ b/TUnit.Assertions.Tests/NumericAssertionTests.cs @@ -0,0 +1,499 @@ +using TUnit.Assertions.Extensions; + +namespace TUnit.Assertions.Tests; + +public class NumericAssertionTests +{ + // Long tests + [Test] + public async Task Test_Long_IsZero() + { + long value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Long_IsZero_Fails_WhenNotZero() + { + long value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Long_IsNotZero() + { + long value = 1234567890L; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Long_IsNotZero_Fails_WhenZero() + { + long value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Long_IsEven() + { + long value = 2; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Long_IsEven_Fails_WhenOdd() + { + long value = 3; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Long_IsOdd() + { + long value = 3; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Long_IsOdd_Fails_WhenEven() + { + long value = 4; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Double tests + [Test] + public async Task Test_Double_IsZero() + { + double value = 0.0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Double_IsZero_Fails_WhenNotZero() + { + double value = 0.1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Double_IsNotZero() + { + double value = 1.5; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Double_IsNotZero_Negative() + { + double value = -3.14; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Double_IsNotZero_Fails_WhenZero() + { + double value = 0.0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + // Float tests + [Test] + public async Task Test_Float_IsZero() + { + float value = 0.0f; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Float_IsZero_Fails_WhenNotZero() + { + float value = 0.1f; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Float_IsNotZero() + { + float value = 2.5f; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Float_IsNotZero_Fails_WhenZero() + { + float value = 0.0f; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + // Decimal tests + [Test] + public async Task Test_Decimal_IsZero() + { + decimal value = 0m; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Decimal_IsZero_Fails_WhenNotZero() + { + decimal value = 0.01m; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Decimal_IsNotZero() + { + decimal value = 99.99m; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Decimal_IsNotZero_Fails_WhenZero() + { + decimal value = 0m; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + // Short tests + [Test] + public async Task Test_Short_IsZero() + { + short value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Short_IsZero_Fails_WhenNotZero() + { + short value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Short_IsNotZero() + { + short value = 100; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Short_IsNotZero_Fails_WhenZero() + { + short value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Short_IsEven() + { + short value = 4; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Short_IsEven_Fails_WhenOdd() + { + short value = 5; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Short_IsOdd() + { + short value = 5; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Short_IsOdd_Fails_WhenEven() + { + short value = 6; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Byte tests + [Test] + public async Task Test_Byte_IsZero() + { + byte value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Byte_IsZero_Fails_WhenNotZero() + { + byte value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Byte_IsNotZero() + { + byte value = 255; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Byte_IsNotZero_Fails_WhenZero() + { + byte value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Byte_IsEven() + { + byte value = 10; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Byte_IsEven_Fails_WhenOdd() + { + byte value = 11; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Byte_IsOdd() + { + byte value = 11; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Byte_IsOdd_Fails_WhenEven() + { + byte value = 12; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Uint tests + [Test] + public async Task Test_Uint_IsZero() + { + uint value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Uint_IsZero_Fails_WhenNotZero() + { + uint value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Uint_IsNotZero() + { + uint value = 12345; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Uint_IsNotZero_Fails_WhenZero() + { + uint value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Uint_IsEven() + { + uint value = 6; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Uint_IsEven_Fails_WhenOdd() + { + uint value = 7; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Uint_IsOdd() + { + uint value = 7; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Uint_IsOdd_Fails_WhenEven() + { + uint value = 8; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Ulong tests + [Test] + public async Task Test_Ulong_IsZero() + { + ulong value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Ulong_IsZero_Fails_WhenNotZero() + { + ulong value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Ulong_IsNotZero() + { + ulong value = 9876543210UL; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Ulong_IsNotZero_Fails_WhenZero() + { + ulong value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Ulong_IsEven() + { + ulong value = 8; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Ulong_IsEven_Fails_WhenOdd() + { + ulong value = 9; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Ulong_IsOdd() + { + ulong value = 9; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Ulong_IsOdd_Fails_WhenEven() + { + ulong value = 10; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Ushort tests + [Test] + public async Task Test_Ushort_IsZero() + { + ushort value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Ushort_IsZero_Fails_WhenNotZero() + { + ushort value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Ushort_IsNotZero() + { + ushort value = 500; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Ushort_IsNotZero_Fails_WhenZero() + { + ushort value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Ushort_IsEven() + { + ushort value = 12; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Ushort_IsEven_Fails_WhenOdd() + { + ushort value = 13; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Ushort_IsOdd() + { + ushort value = 13; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Ushort_IsOdd_Fails_WhenEven() + { + ushort value = 14; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } + + // Sbyte tests + [Test] + public async Task Test_Sbyte_IsZero() + { + sbyte value = 0; + await Assert.That(value).IsZero(); + } + + [Test] + public async Task Test_Sbyte_IsZero_Fails_WhenNotZero() + { + sbyte value = 1; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsZero()); + } + + [Test] + public async Task Test_Sbyte_IsNotZero() + { + sbyte value = -50; + await Assert.That(value).IsNotZero(); + } + + [Test] + public async Task Test_Sbyte_IsNotZero_Fails_WhenZero() + { + sbyte value = 0; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsNotZero()); + } + + [Test] + public async Task Test_Sbyte_IsEven() + { + sbyte value = 14; + await Assert.That(value).IsEven(); + } + + [Test] + public async Task Test_Sbyte_IsEven_Fails_WhenOdd() + { + sbyte value = 15; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsEven()); + } + + [Test] + public async Task Test_Sbyte_IsOdd() + { + sbyte value = 15; + await Assert.That(value).IsOdd(); + } + + [Test] + public async Task Test_Sbyte_IsOdd_Fails_WhenEven() + { + sbyte value = 16; + await Assert.ThrowsAsync(async () => await Assert.That(value).IsOdd()); + } +} diff --git a/TUnit.Assertions/ByteAssertions.cs b/TUnit.Assertions/ByteAssertions.cs new file mode 100644 index 0000000000..f72d3eb33f --- /dev/null +++ b/TUnit.Assertions/ByteAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class ByteAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this byte value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this byte value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this byte value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this byte value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/DecimalAssertions.cs b/TUnit.Assertions/DecimalAssertions.cs new file mode 100644 index 0000000000..6e39c75861 --- /dev/null +++ b/TUnit.Assertions/DecimalAssertions.cs @@ -0,0 +1,18 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class DecimalAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this decimal value) + { + return value == 0m; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this decimal value) + { + return value != 0m; + } +} diff --git a/TUnit.Assertions/DoubleAssertions.cs b/TUnit.Assertions/DoubleAssertions.cs new file mode 100644 index 0000000000..41af24977c --- /dev/null +++ b/TUnit.Assertions/DoubleAssertions.cs @@ -0,0 +1,18 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class DoubleAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this double value) + { + return value == 0.0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this double value) + { + return value != 0.0; + } +} diff --git a/TUnit.Assertions/FloatAssertions.cs b/TUnit.Assertions/FloatAssertions.cs new file mode 100644 index 0000000000..61b2336b47 --- /dev/null +++ b/TUnit.Assertions/FloatAssertions.cs @@ -0,0 +1,18 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class FloatAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this float value) + { + return value == 0.0f; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this float value) + { + return value != 0.0f; + } +} diff --git a/TUnit.Assertions/IntAssertions.cs b/TUnit.Assertions/IntAssertions.cs index 967043fe63..aef19d4ccb 100644 --- a/TUnit.Assertions/IntAssertions.cs +++ b/TUnit.Assertions/IntAssertions.cs @@ -4,6 +4,18 @@ namespace TUnit.Assertions; public static partial class IntAssertions { + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this int value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this int value) + { + return value != 0; + } + [GenerateAssertion] public static bool IsEven(this int value) { diff --git a/TUnit.Assertions/LongAssertions.cs b/TUnit.Assertions/LongAssertions.cs new file mode 100644 index 0000000000..f4ea7a6536 --- /dev/null +++ b/TUnit.Assertions/LongAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class LongAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this long value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this long value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this long value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this long value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/SbyteAssertions.cs b/TUnit.Assertions/SbyteAssertions.cs new file mode 100644 index 0000000000..ce05542d17 --- /dev/null +++ b/TUnit.Assertions/SbyteAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class SbyteAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this sbyte value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this sbyte value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this sbyte value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this sbyte value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/ShortAssertions.cs b/TUnit.Assertions/ShortAssertions.cs new file mode 100644 index 0000000000..4501657bb5 --- /dev/null +++ b/TUnit.Assertions/ShortAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class ShortAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this short value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this short value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this short value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this short value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/UintAssertions.cs b/TUnit.Assertions/UintAssertions.cs new file mode 100644 index 0000000000..812bbe9165 --- /dev/null +++ b/TUnit.Assertions/UintAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class UintAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this uint value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this uint value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this uint value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this uint value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/UlongAssertions.cs b/TUnit.Assertions/UlongAssertions.cs new file mode 100644 index 0000000000..6b5f884db1 --- /dev/null +++ b/TUnit.Assertions/UlongAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class UlongAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this ulong value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this ulong value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this ulong value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this ulong value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.Assertions/UshortAssertions.cs b/TUnit.Assertions/UshortAssertions.cs new file mode 100644 index 0000000000..4fcbd89de5 --- /dev/null +++ b/TUnit.Assertions/UshortAssertions.cs @@ -0,0 +1,30 @@ +using TUnit.Assertions.Attributes; + +namespace TUnit.Assertions; + +public static partial class UshortAssertions +{ + [GenerateAssertion(ExpectationMessage = "to be zero")] + public static bool IsZero(this ushort value) + { + return value == 0; + } + + [GenerateAssertion(ExpectationMessage = "to not be zero")] + public static bool IsNotZero(this ushort value) + { + return value != 0; + } + + [GenerateAssertion] + public static bool IsEven(this ushort value) + { + return value % 2 == 0; + } + + [GenerateAssertion] + public static bool IsOdd(this ushort value) + { + return value % 2 != 0; + } +} diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt index b01026d16a..41cde6962c 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet10_0.verified.txt @@ -49,18 +49,87 @@ namespace public static . ThrowsExactlyAsync(string parameterName, <.> action) where TException : { } } + public static class ByteAssertions + { + [.] + public static bool IsEven(this byte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this byte value) { } + [.] + public static bool IsOdd(this byte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this byte value) { } + } + public static class DecimalAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this decimal value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this decimal value) { } + } + public static class DoubleAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this double value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this double value) { } + } public static class Fail { public static void Test(string reason) { } public static void Unless([.(false)] bool condition, string reason) { } public static void When([.(true)] bool condition, string reason) { } } + public static class FloatAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this float value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this float value) { } + } public static class IntAssertions { [.] public static bool IsEven(this int value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this int value) { } [.] public static bool IsOdd(this int value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this int value) { } + } + public static class LongAssertions + { + [.] + public static bool IsEven(this long value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this long value) { } + [.] + public static bool IsOdd(this long value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this long value) { } + } + public static class SbyteAssertions + { + [.] + public static bool IsEven(this sbyte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this sbyte value) { } + [.] + public static bool IsOdd(this sbyte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this sbyte value) { } + } + public static class ShortAssertions + { + [.] + public static bool IsEven(this short value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this short value) { } + [.] + public static bool IsOdd(this short value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this short value) { } } public class StringMatcher { @@ -70,6 +139,39 @@ namespace public static .StringMatcher AsRegex(string pattern) { } public static .StringMatcher AsWildcard(string pattern) { } } + public static class UintAssertions + { + [.] + public static bool IsEven(this uint value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this uint value) { } + [.] + public static bool IsOdd(this uint value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this uint value) { } + } + public static class UlongAssertions + { + [.] + public static bool IsEven(this ulong value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ulong value) { } + [.] + public static bool IsOdd(this ulong value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ulong value) { } + } + public static class UshortAssertions + { + [.] + public static bool IsEven(this ushort value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ushort value) { } + [.] + public static bool IsOdd(this ushort value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ushort value) { } + } } namespace . { @@ -2127,6 +2229,37 @@ namespace .Extensions public static ._IsTrue_Assertion IsTrue(this . source) { } public static ._IsTrue_Assertion IsTrue(this . source) { } } + public static class ByteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public sealed class Byte_IsEven_Assertion : . + { + public Byte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsNotZero_Assertion : . + { + public Byte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsOdd_Assertion : . + { + public Byte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsZero_Assertion : . + { + public Byte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class CancellationTokenAssertionExtensions { public static . CanBeCanceled(this .<.CancellationToken> source) { } @@ -2707,11 +2840,28 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class DecimalAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DecimalEqualsAssertionExtensions { [.(2)] public static . IsEqualTo(this . source, decimal expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Decimal_IsNotZero_Assertion : . + { + public Decimal_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Decimal_IsZero_Assertion : . + { + public Decimal_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class DirectoryHasFilesAssertionExtensions { public static . HasFiles(this .<.DirectoryInfo> source) { } @@ -2797,6 +2947,11 @@ namespace .Extensions public static . IsPositiveInfinity(this . source) { } public static . IsSubnormal(this . source) { } } + public static class DoubleAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DoubleEqualsAssertionExtensions { [.(2)] @@ -2844,6 +2999,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Double_IsNotZero_Assertion : . + { + public Double_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Double_IsZero_Assertion : . + { + public Double_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class EncodingAssertionExtensions { public static ._IsASCII_Assertion IsASCII(this .<.Encoding> source) { } @@ -3063,6 +3230,11 @@ namespace .Extensions { public static . IsNotSystem(this .<.FileInfo> source) { } } + public static class FloatAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class FloatEqualsAssertionExtensions { [.(2)] @@ -3110,6 +3282,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Float_IsNotZero_Assertion : . + { + public Float_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Float_IsZero_Assertion : . + { + public Float_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] @@ -3288,10 +3472,36 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class Int16_IsEven_Assertion : . + { + public Int16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsNotZero_Assertion : . + { + public Int16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsOdd_Assertion : . + { + public Int16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsZero_Assertion : . + { + public Int16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IntAssertions { public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } } public static class IntEqualsAssertionExtensions { @@ -3304,12 +3514,24 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsNotZero_Assertion : . + { + public Int_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public sealed class Int_IsOdd_Assertion : . { public Int_IsOdd_Assertion(. context) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsZero_Assertion : . + { + public Int_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IsAssignableToAssertionExtensions { public static . IsAssignableTo(this . source) { } @@ -3394,11 +3616,42 @@ namespace .Extensions public static . IsLessThanOrEqualTo(this . source, TValue maximum, [.("maximum")] string? maximumExpression = null) where TValue : { } } + public static class LongAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class LongEqualsAssertionExtensions { [.(2)] public static . IsEqualTo(this . source, long expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Long_IsEven_Assertion : . + { + public Long_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsNotZero_Assertion : . + { + public Long_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsOdd_Assertion : . + { + public Long_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsZero_Assertion : . + { + public Long_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class NotEqualsAssertionExtensions { public static . IsNotEqualTo(this . source, TValue notExpected, .? comparer = null, [.("notExpected")] string? notExpectedExpression = null, [.("comparer")] string? comparerExpression = null) { } @@ -3629,10 +3882,48 @@ namespace .Extensions protected override .<.> CheckAsync(.<.Rune> metadata) { } protected override string GetExpectation() { } } + public sealed class SByte_IsEven_Assertion : . + { + public SByte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsNotZero_Assertion : . + { + public SByte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsOdd_Assertion : . + { + public SByte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsZero_Assertion : . + { + public SByte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class SameReferenceAssertionExtensions { public static . IsSameReferenceAs(this . source, object? expected, [.("expected")] string? expectedExpression = null) { } } + public static class SbyteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public static class ShortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class SingleAssertionExtensions { public static . IsFinite(this . source) { } @@ -4226,6 +4517,92 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class UInt16_IsEven_Assertion : . + { + public UInt16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsNotZero_Assertion : . + { + public UInt16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsOdd_Assertion : . + { + public UInt16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsZero_Assertion : . + { + public UInt16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsEven_Assertion : . + { + public UInt32_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsNotZero_Assertion : . + { + public UInt32_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsOdd_Assertion : . + { + public UInt32_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsZero_Assertion : . + { + public UInt32_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsEven_Assertion : . + { + public UInt64_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsNotZero_Assertion : . + { + public UInt64_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsOdd_Assertion : . + { + public UInt64_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsZero_Assertion : . + { + public UInt64_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public static class UintAssertions + { + public static .32_IsEven_Assertion IsEven(this . source) { } + public static .32_IsNotZero_Assertion IsNotZero(this . source) { } + public static .32_IsOdd_Assertion IsOdd(this . source) { } + public static .32_IsZero_Assertion IsZero(this . source) { } + } + public static class UlongAssertions + { + public static .64_IsEven_Assertion IsEven(this . source) { } + public static .64_IsNotZero_Assertion IsNotZero(this . source) { } + public static .64_IsOdd_Assertion IsOdd(this . source) { } + public static .64_IsZero_Assertion IsZero(this . source) { } + } public static class UriAssertionExtensions { public static . IsAbsoluteUri(this .<> source) { } @@ -4277,6 +4654,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class UshortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class ValueTaskAssertionExtensions { public static . IsCanceled(this .<.> source) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt index e49c7b0caf..a966ad67ee 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt @@ -46,18 +46,87 @@ namespace public static . ThrowsExactlyAsync(string parameterName, <.> action) where TException : { } } + public static class ByteAssertions + { + [.] + public static bool IsEven(this byte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this byte value) { } + [.] + public static bool IsOdd(this byte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this byte value) { } + } + public static class DecimalAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this decimal value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this decimal value) { } + } + public static class DoubleAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this double value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this double value) { } + } public static class Fail { public static void Test(string reason) { } public static void Unless([.(false)] bool condition, string reason) { } public static void When([.(true)] bool condition, string reason) { } } + public static class FloatAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this float value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this float value) { } + } public static class IntAssertions { [.] public static bool IsEven(this int value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this int value) { } [.] public static bool IsOdd(this int value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this int value) { } + } + public static class LongAssertions + { + [.] + public static bool IsEven(this long value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this long value) { } + [.] + public static bool IsOdd(this long value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this long value) { } + } + public static class SbyteAssertions + { + [.] + public static bool IsEven(this sbyte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this sbyte value) { } + [.] + public static bool IsOdd(this sbyte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this sbyte value) { } + } + public static class ShortAssertions + { + [.] + public static bool IsEven(this short value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this short value) { } + [.] + public static bool IsOdd(this short value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this short value) { } } public class StringMatcher { @@ -67,6 +136,39 @@ namespace public static .StringMatcher AsRegex(string pattern) { } public static .StringMatcher AsWildcard(string pattern) { } } + public static class UintAssertions + { + [.] + public static bool IsEven(this uint value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this uint value) { } + [.] + public static bool IsOdd(this uint value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this uint value) { } + } + public static class UlongAssertions + { + [.] + public static bool IsEven(this ulong value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ulong value) { } + [.] + public static bool IsOdd(this ulong value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ulong value) { } + } + public static class UshortAssertions + { + [.] + public static bool IsEven(this ushort value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ushort value) { } + [.] + public static bool IsOdd(this ushort value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ushort value) { } + } } namespace . { @@ -2117,6 +2219,37 @@ namespace .Extensions public static ._IsTrue_Assertion IsTrue(this . source) { } public static ._IsTrue_Assertion IsTrue(this . source) { } } + public static class ByteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public sealed class Byte_IsEven_Assertion : . + { + public Byte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsNotZero_Assertion : . + { + public Byte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsOdd_Assertion : . + { + public Byte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsZero_Assertion : . + { + public Byte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class CancellationTokenAssertionExtensions { public static . CanBeCanceled(this .<.CancellationToken> source) { } @@ -2694,10 +2827,27 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class DecimalAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DecimalEqualsAssertionExtensions { public static . IsEqualTo(this . source, decimal expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Decimal_IsNotZero_Assertion : . + { + public Decimal_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Decimal_IsZero_Assertion : . + { + public Decimal_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class DirectoryHasFilesAssertionExtensions { public static . HasFiles(this .<.DirectoryInfo> source) { } @@ -2783,6 +2933,11 @@ namespace .Extensions public static . IsPositiveInfinity(this . source) { } public static . IsSubnormal(this . source) { } } + public static class DoubleAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DoubleEqualsAssertionExtensions { public static . IsEqualTo(this . source, double expected, [.("expected")] string? expectedExpression = null) { } @@ -2829,6 +2984,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Double_IsNotZero_Assertion : . + { + public Double_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Double_IsZero_Assertion : . + { + public Double_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class EncodingAssertionExtensions { public static ._IsASCII_Assertion IsASCII(this .<.Encoding> source) { } @@ -3048,6 +3215,11 @@ namespace .Extensions { public static . IsNotSystem(this .<.FileInfo> source) { } } + public static class FloatAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class FloatEqualsAssertionExtensions { public static . IsEqualTo(this . source, float expected, [.("expected")] string? expectedExpression = null) { } @@ -3094,6 +3266,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Float_IsNotZero_Assertion : . + { + public Float_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Float_IsZero_Assertion : . + { + public Float_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] @@ -3272,10 +3456,36 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class Int16_IsEven_Assertion : . + { + public Int16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsNotZero_Assertion : . + { + public Int16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsOdd_Assertion : . + { + public Int16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsZero_Assertion : . + { + public Int16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IntAssertions { public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } } public static class IntEqualsAssertionExtensions { @@ -3287,12 +3497,24 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsNotZero_Assertion : . + { + public Int_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public sealed class Int_IsOdd_Assertion : . { public Int_IsOdd_Assertion(. context) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsZero_Assertion : . + { + public Int_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IsAssignableToAssertionExtensions { public static . IsAssignableTo(this . source) { } @@ -3377,10 +3599,41 @@ namespace .Extensions public static . IsLessThanOrEqualTo(this . source, TValue maximum, [.("maximum")] string? maximumExpression = null) where TValue : { } } + public static class LongAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class LongEqualsAssertionExtensions { public static . IsEqualTo(this . source, long expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Long_IsEven_Assertion : . + { + public Long_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsNotZero_Assertion : . + { + public Long_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsOdd_Assertion : . + { + public Long_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsZero_Assertion : . + { + public Long_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class NotEqualsAssertionExtensions { public static . IsNotEqualTo(this . source, TValue notExpected, .? comparer = null, [.("notExpected")] string? notExpectedExpression = null, [.("comparer")] string? comparerExpression = null) { } @@ -3611,10 +3864,48 @@ namespace .Extensions protected override .<.> CheckAsync(.<.Rune> metadata) { } protected override string GetExpectation() { } } + public sealed class SByte_IsEven_Assertion : . + { + public SByte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsNotZero_Assertion : . + { + public SByte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsOdd_Assertion : . + { + public SByte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsZero_Assertion : . + { + public SByte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class SameReferenceAssertionExtensions { public static . IsSameReferenceAs(this . source, object? expected, [.("expected")] string? expectedExpression = null) { } } + public static class SbyteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public static class ShortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class SingleAssertionExtensions { public static . IsFinite(this . source) { } @@ -4204,6 +4495,92 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class UInt16_IsEven_Assertion : . + { + public UInt16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsNotZero_Assertion : . + { + public UInt16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsOdd_Assertion : . + { + public UInt16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsZero_Assertion : . + { + public UInt16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsEven_Assertion : . + { + public UInt32_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsNotZero_Assertion : . + { + public UInt32_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsOdd_Assertion : . + { + public UInt32_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsZero_Assertion : . + { + public UInt32_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsEven_Assertion : . + { + public UInt64_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsNotZero_Assertion : . + { + public UInt64_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsOdd_Assertion : . + { + public UInt64_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsZero_Assertion : . + { + public UInt64_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public static class UintAssertions + { + public static .32_IsEven_Assertion IsEven(this . source) { } + public static .32_IsNotZero_Assertion IsNotZero(this . source) { } + public static .32_IsOdd_Assertion IsOdd(this . source) { } + public static .32_IsZero_Assertion IsZero(this . source) { } + } + public static class UlongAssertions + { + public static .64_IsEven_Assertion IsEven(this . source) { } + public static .64_IsNotZero_Assertion IsNotZero(this . source) { } + public static .64_IsOdd_Assertion IsOdd(this . source) { } + public static .64_IsZero_Assertion IsZero(this . source) { } + } public static class UriAssertionExtensions { public static . IsAbsoluteUri(this .<> source) { } @@ -4255,6 +4632,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class UshortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class ValueTaskAssertionExtensions { public static . IsCanceled(this .<.> source) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt index 111878a3dc..90292db45c 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt @@ -49,18 +49,87 @@ namespace public static . ThrowsExactlyAsync(string parameterName, <.> action) where TException : { } } + public static class ByteAssertions + { + [.] + public static bool IsEven(this byte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this byte value) { } + [.] + public static bool IsOdd(this byte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this byte value) { } + } + public static class DecimalAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this decimal value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this decimal value) { } + } + public static class DoubleAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this double value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this double value) { } + } public static class Fail { public static void Test(string reason) { } public static void Unless([.(false)] bool condition, string reason) { } public static void When([.(true)] bool condition, string reason) { } } + public static class FloatAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this float value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this float value) { } + } public static class IntAssertions { [.] public static bool IsEven(this int value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this int value) { } [.] public static bool IsOdd(this int value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this int value) { } + } + public static class LongAssertions + { + [.] + public static bool IsEven(this long value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this long value) { } + [.] + public static bool IsOdd(this long value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this long value) { } + } + public static class SbyteAssertions + { + [.] + public static bool IsEven(this sbyte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this sbyte value) { } + [.] + public static bool IsOdd(this sbyte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this sbyte value) { } + } + public static class ShortAssertions + { + [.] + public static bool IsEven(this short value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this short value) { } + [.] + public static bool IsOdd(this short value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this short value) { } } public class StringMatcher { @@ -70,6 +139,39 @@ namespace public static .StringMatcher AsRegex(string pattern) { } public static .StringMatcher AsWildcard(string pattern) { } } + public static class UintAssertions + { + [.] + public static bool IsEven(this uint value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this uint value) { } + [.] + public static bool IsOdd(this uint value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this uint value) { } + } + public static class UlongAssertions + { + [.] + public static bool IsEven(this ulong value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ulong value) { } + [.] + public static bool IsOdd(this ulong value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ulong value) { } + } + public static class UshortAssertions + { + [.] + public static bool IsEven(this ushort value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ushort value) { } + [.] + public static bool IsOdd(this ushort value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ushort value) { } + } } namespace . { @@ -2127,6 +2229,37 @@ namespace .Extensions public static ._IsTrue_Assertion IsTrue(this . source) { } public static ._IsTrue_Assertion IsTrue(this . source) { } } + public static class ByteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public sealed class Byte_IsEven_Assertion : . + { + public Byte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsNotZero_Assertion : . + { + public Byte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsOdd_Assertion : . + { + public Byte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsZero_Assertion : . + { + public Byte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class CancellationTokenAssertionExtensions { public static . CanBeCanceled(this .<.CancellationToken> source) { } @@ -2707,11 +2840,28 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class DecimalAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DecimalEqualsAssertionExtensions { [.(2)] public static . IsEqualTo(this . source, decimal expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Decimal_IsNotZero_Assertion : . + { + public Decimal_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Decimal_IsZero_Assertion : . + { + public Decimal_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class DirectoryHasFilesAssertionExtensions { public static . HasFiles(this .<.DirectoryInfo> source) { } @@ -2797,6 +2947,11 @@ namespace .Extensions public static . IsPositiveInfinity(this . source) { } public static . IsSubnormal(this . source) { } } + public static class DoubleAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DoubleEqualsAssertionExtensions { [.(2)] @@ -2844,6 +2999,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Double_IsNotZero_Assertion : . + { + public Double_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Double_IsZero_Assertion : . + { + public Double_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class EncodingAssertionExtensions { public static ._IsASCII_Assertion IsASCII(this .<.Encoding> source) { } @@ -3063,6 +3230,11 @@ namespace .Extensions { public static . IsNotSystem(this .<.FileInfo> source) { } } + public static class FloatAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class FloatEqualsAssertionExtensions { [.(2)] @@ -3110,6 +3282,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Float_IsNotZero_Assertion : . + { + public Float_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Float_IsZero_Assertion : . + { + public Float_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class GenericAssertions { [.("Trimming", "IL2091", Justification="Generic type parameter is only used for property access, not instantiation")] @@ -3288,10 +3472,36 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class Int16_IsEven_Assertion : . + { + public Int16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsNotZero_Assertion : . + { + public Int16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsOdd_Assertion : . + { + public Int16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsZero_Assertion : . + { + public Int16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IntAssertions { public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } } public static class IntEqualsAssertionExtensions { @@ -3304,12 +3514,24 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsNotZero_Assertion : . + { + public Int_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public sealed class Int_IsOdd_Assertion : . { public Int_IsOdd_Assertion(. context) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsZero_Assertion : . + { + public Int_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IsAssignableToAssertionExtensions { public static . IsAssignableTo(this . source) { } @@ -3394,11 +3616,42 @@ namespace .Extensions public static . IsLessThanOrEqualTo(this . source, TValue maximum, [.("maximum")] string? maximumExpression = null) where TValue : { } } + public static class LongAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class LongEqualsAssertionExtensions { [.(2)] public static . IsEqualTo(this . source, long expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Long_IsEven_Assertion : . + { + public Long_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsNotZero_Assertion : . + { + public Long_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsOdd_Assertion : . + { + public Long_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsZero_Assertion : . + { + public Long_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class NotEqualsAssertionExtensions { public static . IsNotEqualTo(this . source, TValue notExpected, .? comparer = null, [.("notExpected")] string? notExpectedExpression = null, [.("comparer")] string? comparerExpression = null) { } @@ -3629,10 +3882,48 @@ namespace .Extensions protected override .<.> CheckAsync(.<.Rune> metadata) { } protected override string GetExpectation() { } } + public sealed class SByte_IsEven_Assertion : . + { + public SByte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsNotZero_Assertion : . + { + public SByte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsOdd_Assertion : . + { + public SByte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsZero_Assertion : . + { + public SByte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class SameReferenceAssertionExtensions { public static . IsSameReferenceAs(this . source, object? expected, [.("expected")] string? expectedExpression = null) { } } + public static class SbyteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public static class ShortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class SingleAssertionExtensions { public static . IsFinite(this . source) { } @@ -4226,6 +4517,92 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class UInt16_IsEven_Assertion : . + { + public UInt16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsNotZero_Assertion : . + { + public UInt16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsOdd_Assertion : . + { + public UInt16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsZero_Assertion : . + { + public UInt16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsEven_Assertion : . + { + public UInt32_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsNotZero_Assertion : . + { + public UInt32_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsOdd_Assertion : . + { + public UInt32_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsZero_Assertion : . + { + public UInt32_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsEven_Assertion : . + { + public UInt64_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsNotZero_Assertion : . + { + public UInt64_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsOdd_Assertion : . + { + public UInt64_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsZero_Assertion : . + { + public UInt64_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public static class UintAssertions + { + public static .32_IsEven_Assertion IsEven(this . source) { } + public static .32_IsNotZero_Assertion IsNotZero(this . source) { } + public static .32_IsOdd_Assertion IsOdd(this . source) { } + public static .32_IsZero_Assertion IsZero(this . source) { } + } + public static class UlongAssertions + { + public static .64_IsEven_Assertion IsEven(this . source) { } + public static .64_IsNotZero_Assertion IsNotZero(this . source) { } + public static .64_IsOdd_Assertion IsOdd(this . source) { } + public static .64_IsZero_Assertion IsZero(this . source) { } + } public static class UriAssertionExtensions { public static . IsAbsoluteUri(this .<> source) { } @@ -4277,6 +4654,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class UshortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class ValueTaskAssertionExtensions { public static . IsCanceled(this .<.> source) { } diff --git a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt index 4f4fd95a69..f54303359d 100644 --- a/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt +++ b/TUnit.PublicAPI/Tests.Assertions_Library_Has_No_API_Changes.Net4_7.verified.txt @@ -46,18 +46,87 @@ namespace public static . ThrowsExactlyAsync(string parameterName, <.> action) where TException : { } } + public static class ByteAssertions + { + [.] + public static bool IsEven(this byte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this byte value) { } + [.] + public static bool IsOdd(this byte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this byte value) { } + } + public static class DecimalAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this decimal value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this decimal value) { } + } + public static class DoubleAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this double value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this double value) { } + } public static class Fail { public static void Test(string reason) { } public static void Unless([.(false)] bool condition, string reason) { } public static void When([.(true)] bool condition, string reason) { } } + public static class FloatAssertions + { + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this float value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this float value) { } + } public static class IntAssertions { [.] public static bool IsEven(this int value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this int value) { } [.] public static bool IsOdd(this int value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this int value) { } + } + public static class LongAssertions + { + [.] + public static bool IsEven(this long value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this long value) { } + [.] + public static bool IsOdd(this long value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this long value) { } + } + public static class SbyteAssertions + { + [.] + public static bool IsEven(this sbyte value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this sbyte value) { } + [.] + public static bool IsOdd(this sbyte value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this sbyte value) { } + } + public static class ShortAssertions + { + [.] + public static bool IsEven(this short value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this short value) { } + [.] + public static bool IsOdd(this short value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this short value) { } } public class StringMatcher { @@ -67,6 +136,39 @@ namespace public static .StringMatcher AsRegex(string pattern) { } public static .StringMatcher AsWildcard(string pattern) { } } + public static class UintAssertions + { + [.] + public static bool IsEven(this uint value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this uint value) { } + [.] + public static bool IsOdd(this uint value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this uint value) { } + } + public static class UlongAssertions + { + [.] + public static bool IsEven(this ulong value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ulong value) { } + [.] + public static bool IsOdd(this ulong value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ulong value) { } + } + public static class UshortAssertions + { + [.] + public static bool IsEven(this ushort value) { } + [.(ExpectationMessage="to not be zero")] + public static bool IsNotZero(this ushort value) { } + [.] + public static bool IsOdd(this ushort value) { } + [.(ExpectationMessage="to be zero")] + public static bool IsZero(this ushort value) { } + } } namespace . { @@ -1925,6 +2027,37 @@ namespace .Extensions public static ._IsTrue_Assertion IsTrue(this . source) { } public static ._IsTrue_Assertion IsTrue(this . source) { } } + public static class ByteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public sealed class Byte_IsEven_Assertion : . + { + public Byte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsNotZero_Assertion : . + { + public Byte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsOdd_Assertion : . + { + public Byte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Byte_IsZero_Assertion : . + { + public Byte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class CancellationTokenAssertionExtensions { public static . CanBeCanceled(this .<.CancellationToken> source) { } @@ -2425,10 +2558,27 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class DecimalAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DecimalEqualsAssertionExtensions { public static . IsEqualTo(this . source, decimal expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Decimal_IsNotZero_Assertion : . + { + public Decimal_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Decimal_IsZero_Assertion : . + { + public Decimal_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class DirectoryHasFilesAssertionExtensions { public static . HasFiles(this .<.DirectoryInfo> source) { } @@ -2508,6 +2658,11 @@ namespace .Extensions public static . IsNotPositiveInfinity(this . source) { } public static . IsPositiveInfinity(this . source) { } } + public static class DoubleAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class DoubleEqualsAssertionExtensions { public static . IsEqualTo(this . source, double expected, [.("expected")] string? expectedExpression = null) { } @@ -2536,6 +2691,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Double_IsNotZero_Assertion : . + { + public Double_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Double_IsZero_Assertion : . + { + public Double_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class EncodingAssertionExtensions { public static ._IsASCII_Assertion IsASCII(this .<.Encoding> source) { } @@ -2755,6 +2922,11 @@ namespace .Extensions { public static . IsNotSystem(this .<.FileInfo> source) { } } + public static class FloatAssertions + { + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class FloatEqualsAssertionExtensions { public static . IsEqualTo(this . source, float expected, [.("expected")] string? expectedExpression = null) { } @@ -2783,6 +2955,18 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Float_IsNotZero_Assertion : . + { + public Float_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Float_IsZero_Assertion : . + { + public Float_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class GenericAssertions { public static .Extensions.T_IsIn__Assertion IsIn(this . source, params T[] collection) { } @@ -2942,10 +3126,36 @@ namespace .Extensions protected override .<.> CheckAsync(.<.IPAddress> metadata) { } protected override string GetExpectation() { } } + public sealed class Int16_IsEven_Assertion : . + { + public Int16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsNotZero_Assertion : . + { + public Int16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsOdd_Assertion : . + { + public Int16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Int16_IsZero_Assertion : . + { + public Int16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IntAssertions { public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } } public static class IntEqualsAssertionExtensions { @@ -2957,12 +3167,24 @@ namespace .Extensions protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsNotZero_Assertion : . + { + public Int_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public sealed class Int_IsOdd_Assertion : . { public Int_IsOdd_Assertion(. context) { } protected override .<.> CheckAsync(. metadata) { } protected override string GetExpectation() { } } + public sealed class Int_IsZero_Assertion : . + { + public Int_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class IsAssignableToAssertionExtensions { public static . IsAssignableTo(this . source) { } @@ -3039,10 +3261,41 @@ namespace .Extensions public static . IsLessThanOrEqualTo(this . source, TValue maximum, [.("maximum")] string? maximumExpression = null) where TValue : { } } + public static class LongAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } public static class LongEqualsAssertionExtensions { public static . IsEqualTo(this . source, long expected, [.("expected")] string? expectedExpression = null) { } } + public sealed class Long_IsEven_Assertion : . + { + public Long_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsNotZero_Assertion : . + { + public Long_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsOdd_Assertion : . + { + public Long_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class Long_IsZero_Assertion : . + { + public Long_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class NotEqualsAssertionExtensions { public static . IsNotEqualTo(this . source, TValue notExpected, .? comparer = null, [.("notExpected")] string? notExpectedExpression = null, [.("comparer")] string? comparerExpression = null) { } @@ -3133,10 +3386,48 @@ namespace .Extensions public static . Matches(this . source, . regex, [.("regex")] string? regexExpression = null) { } public static . Matches(this . source, string pattern, [.("pattern")] string? patternExpression = null) { } } + public sealed class SByte_IsEven_Assertion : . + { + public SByte_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsNotZero_Assertion : . + { + public SByte_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsOdd_Assertion : . + { + public SByte_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class SByte_IsZero_Assertion : . + { + public SByte_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } public static class SameReferenceAssertionExtensions { public static . IsSameReferenceAs(this . source, object? expected, [.("expected")] string? expectedExpression = null) { } } + public static class SbyteAssertions + { + public static ._IsEven_Assertion IsEven(this . source) { } + public static ._IsNotZero_Assertion IsNotZero(this . source) { } + public static ._IsOdd_Assertion IsOdd(this . source) { } + public static ._IsZero_Assertion IsZero(this . source) { } + } + public static class ShortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class SingleAssertionExtensions { public static . IsInfinity(this . source) { } @@ -3638,6 +3929,92 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public sealed class UInt16_IsEven_Assertion : . + { + public UInt16_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsNotZero_Assertion : . + { + public UInt16_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsOdd_Assertion : . + { + public UInt16_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt16_IsZero_Assertion : . + { + public UInt16_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsEven_Assertion : . + { + public UInt32_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsNotZero_Assertion : . + { + public UInt32_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsOdd_Assertion : . + { + public UInt32_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt32_IsZero_Assertion : . + { + public UInt32_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsEven_Assertion : . + { + public UInt64_IsEven_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsNotZero_Assertion : . + { + public UInt64_IsNotZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsOdd_Assertion : . + { + public UInt64_IsOdd_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public sealed class UInt64_IsZero_Assertion : . + { + public UInt64_IsZero_Assertion(. context) { } + protected override .<.> CheckAsync(. metadata) { } + protected override string GetExpectation() { } + } + public static class UintAssertions + { + public static .32_IsEven_Assertion IsEven(this . source) { } + public static .32_IsNotZero_Assertion IsNotZero(this . source) { } + public static .32_IsOdd_Assertion IsOdd(this . source) { } + public static .32_IsZero_Assertion IsZero(this . source) { } + } + public static class UlongAssertions + { + public static .64_IsEven_Assertion IsEven(this . source) { } + public static .64_IsNotZero_Assertion IsNotZero(this . source) { } + public static .64_IsOdd_Assertion IsOdd(this . source) { } + public static .64_IsZero_Assertion IsZero(this . source) { } + } public static class UriAssertionExtensions { public static . IsAbsoluteUri(this .<> source) { } @@ -3689,6 +4066,13 @@ namespace .Extensions protected override .<.> CheckAsync(.<> metadata) { } protected override string GetExpectation() { } } + public static class UshortAssertions + { + public static .16_IsEven_Assertion IsEven(this . source) { } + public static .16_IsNotZero_Assertion IsNotZero(this . source) { } + public static .16_IsOdd_Assertion IsOdd(this . source) { } + public static .16_IsZero_Assertion IsZero(this . source) { } + } public static class ValueTaskAssertionExtensions { public static . IsCanceled(this .<.> source) { }