Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Mar 14, 2024
1 parent 2142cf1 commit acb8bb9
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,46 @@ public void Equality_Operator_Returns_True_For_Same_Version()
// Assert
Assert.IsTrue(result);
}

[TestMethod]
public void Equality_LeftNull()
{
// Arrange
var version2 = new SemVersion(1, 2, 3, "alpha", "build");

// Act
var result = null! == version2;

// Assert
Assert.IsFalse(result);
}

[TestMethod]
public void Equality_RightNull()
{
// Arrange
var version1 = new SemVersion(1, 2, 3, "alpha", "build");

// Act
var result = version1 == null!;

// Assert
Assert.IsFalse(result);
}

[TestMethod]
public void Equality_BothNull()
{
// Arrange
SemVersion version1 = null!;
SemVersion version2 = null!;

// Act
var result = version1 == version2;

// Assert
Assert.IsTrue(result);
}

[TestMethod]
public void Equality_Operator_Returns_False_For_Different_Version()
Expand Down

0 comments on commit acb8bb9

Please sign in to comment.