public void Equals_is_false_ResponseCode_doesnt_match() { var response1 = new SmtpResponse(250, ""); var response2 = new SmtpResponse(251, ""); Assert.False(response1.Equals(response2)); Assert.False(response1.Equals((object)response2)); Assert.NotEqual(response1.GetHashCode(), response2.GetHashCode()); }
public void Equals_is_false_ResponseText_doesnt_match() { var response1 = new SmtpResponse(250, "text"); var response2 = new SmtpResponse(250, "different text"); Assert.False(response1.Equals(response2)); Assert.False(response1.Equals((object)response2)); Assert.NotEqual(response1.GetHashCode(), response2.GetHashCode()); }
public void Equals_is_true_when_everything_matches() { var response1 = new SmtpResponse(250, "same", new[] { "line" }); var response2 = new SmtpResponse(250, "same", new[] { "line" }); Assert.True(response1.Equals(response2)); Assert.True(response1.Equals((object)response2)); Assert.Equal(response1.GetHashCode(), response2.GetHashCode()); }