-
-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathByteAssertions.cs
More file actions
30 lines (25 loc) · 639 Bytes
/
ByteAssertions.cs
File metadata and controls
30 lines (25 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}
}