public void Equals_should_return_true_if_all_fields_are_equal(int w) { var wCount1 = new WriteConcern.WCount(w); var wCount2 = new WriteConcern.WCount(w); wCount1.Equals(wCount2).Should().BeTrue(); wCount1.Equals((object)wCount2).Should().BeTrue(); wCount1.GetHashCode().Should().Be(wCount2.GetHashCode()); }
public void Equals_should_return_false_if_any_fields_are_not_equal(int w1, int w2) { var wCount1 = new WriteConcern.WCount(w1); var wCount2 = new WriteConcern.WCount(w2); wCount1.Equals(wCount2).Should().BeFalse(); wCount1.Equals((object)wCount2).Should().BeFalse(); wCount1.GetHashCode().Should().NotBe(wCount2.GetHashCode()); }
public void Equals_should_return_true_if_all_fields_are_equal() { var subject1 = new WriteConcern.WCount(1); var subject2 = new WriteConcern.WCount(1); var result1 = subject1.Equals(subject2); var result2 = subject1.Equals((object)subject2); var hashCode1 = subject1.GetHashCode(); var hashCode2 = subject2.GetHashCode(); result1.Should().BeTrue(); result2.Should().BeTrue(); hashCode1.Should().Be(hashCode2); }
public void Equals_should_return_false_if_any_fields_are_not_equal() { var subject1 = new WriteConcern.WCount(0); var subject2 = new WriteConcern.WCount(1); var result1 = subject1.Equals(subject2); var result2 = subject1.Equals((object)subject2); var hashCode1 = subject1.GetHashCode(); var hashCode2 = subject2.GetHashCode(); result1.Should().BeFalse(); result2.Should().BeFalse(); hashCode1.Should().NotBe(hashCode2); }