public void EqualsTest() { var uut1 = new DateTimeSettings(); var uut2 = new DateTimeSettings(); this.EqualsSuccessTest(uut1, uut2); // null or invalid types should be false. Assert.IsFalse(uut1.Equals(null)); Assert.IsFalse(uut1.Equals(1)); // Start changing things. uut2 = uut1 with { DateFormat = DateFormat.YearMonthDay }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { DateSeparatorFormat = DateSeparatorFormat.Dashes }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { DurationFormat = DurationFormat.HourMinuteSecond }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { DurationSeparator = DurationSeparator.LettersOnly }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { MonthFormat = MonthFormat.FullMonth }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { TimeFormat = TimeFormat.Hour24 }; EqualsFailureTest(uut1, uut2); uut2 = uut1 with { TimeZoneIdentifier = "UTC" }; EqualsFailureTest(uut1, uut2); }
private void EqualsFailureTest(DateTimeSettings left, DateTimeSettings right) { Assert.IsFalse(left.Equals(right)); Assert.IsFalse(right.Equals(left)); Assert.IsFalse(left == right); Assert.IsFalse(right == left);; Assert.IsTrue(left != right); Assert.IsTrue(right != left);; }