Skip to content

Commit ef45583

Browse files
committed
unit tests
1 parent b632408 commit ef45583

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/Danom.Tests/UnitTests.cs

+28
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,32 @@ public void ToStringShouldProduceBrackets()
1515
{
1616
Assert.Equal("()", Unit.Value.ToString());
1717
}
18+
19+
[Fact]
20+
public void GetHashCodeShouldBeZero()
21+
{
22+
Assert.Equal(0, Unit.Value.GetHashCode());
23+
}
24+
25+
[Fact]
26+
public void CompareToShouldBeZero()
27+
{
28+
Assert.Equal(0, Unit.Value.CompareTo(Unit.Value));
29+
}
30+
31+
[Fact]
32+
public void EqualityOperatorShouldWork()
33+
{
34+
#pragma warning disable CS1718 // Comparison made to same variable
35+
Assert.True(Unit.Value == Unit.Value);
36+
#pragma warning restore CS1718 // Comparison made to same variable
37+
}
38+
39+
[Fact]
40+
public void InequalityOperatorShouldWork()
41+
{
42+
#pragma warning disable CS1718 // Comparison made to same variable
43+
Assert.False(Unit.Value != Unit.Value);
44+
#pragma warning restore CS1718 // Comparison made to same variable
45+
}
1846
}

0 commit comments

Comments
 (0)