public void Equals_OtherIsNull_ReturnsFalse() { // Arrange var productSuggestion = new ProductSuggestion { ProductCode = "FLEBM90-32M", ProductId = 36864 }; // Act bool equal = productSuggestion.Equals(null); // Assert Assert.IsFalse(equal); }
public void Equals_OtherIsEqual_ReturnsTrue() { // Arrange var productSuggestion = new ProductSuggestion { ProductCode = "FLEBM90-32M", ProductId = 36864 }; var otherProductSuggestion = new ProductSuggestion { ProductCode = "FLEBM90-32M", ProductId = 36864 }; // Act bool equal = productSuggestion.Equals(otherProductSuggestion); // Assert Assert.IsTrue(equal); }
public void ParseToString_ToStringThenParse_ReturnsSame() { // Arrange var productSuggestion = new ProductSuggestion { ProductCode = "FLEBM90-32M", ProductId = 36864 }; // Act string serialised = productSuggestion.ToString(); var deserialised = ProductSuggestion.Parse(serialised); // Assert Assert.IsTrue(productSuggestion.Equals(deserialised)); }