public void SchedulesWithEqualValuesAreEqual() { // Arrange. var pattern1 = Mock.Create<ISchedulePattern>(Behavior.CallOriginal); var pattern2 = Mock.Create<ISchedulePattern>(Behavior.CallOriginal); Mock.Arrange(() => pattern1.Equals(pattern2)).Returns(true); Mock.Arrange(() => pattern2.Equals(pattern1)).Returns(true); var frequency1 = Mock.Create<IScheduleDailyFrequency>(Behavior.CallOriginal); var frequency2 = Mock.Create<IScheduleDailyFrequency>(Behavior.CallOriginal); Mock.Arrange(() => frequency1.Equals(frequency2)).Returns(true); Mock.Arrange(() => frequency2.Equals(frequency1)).Returns(true); var target = new Schedule { Guid = Guid.Parse("{FFBE399A-F417-487B-BC2B-1D1B2CBDF578}"), Name = "Schedule", Description = "Description", IsActive = true, StartDate = new DateTime(2013, 1, 16), EndDate = new DateTime(2013, 1, 17), Pattern = pattern1, DailyFrequency = frequency1 }; var other = new Schedule { Guid = Guid.Parse("{FFBE399A-F417-487B-BC2B-1D1B2CBDF578}"), Name = "Schedule", Description = "Description", IsActive = true, StartDate = new DateTime(2013, 1, 16), EndDate = new DateTime(2013, 1, 17), Pattern = pattern2, DailyFrequency = frequency2 }; // Assert. Assert.IsTrue(target.Equals(other)); }
public void SchedulesWithDifferentPatternAreNotEqual() { var pattern1 = Mock.Create<ISchedulePattern>(Behavior.CallOriginal); var pattern2 = Mock.Create<ISchedulePattern>(Behavior.CallOriginal); Mock.Arrange(() => pattern1.Equals(pattern2)).Returns(false); Mock.Arrange(() => pattern2.Equals(pattern1)).Returns(false); var target = new Schedule { Pattern = pattern1 }; var other = new Schedule { Pattern = pattern2 }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentDailyFrequencyAreNotEqual() { var frequency1 = Mock.Create<IScheduleDailyFrequency>(Behavior.CallOriginal); var frequency2 = Mock.Create<IScheduleDailyFrequency>(Behavior.CallOriginal); Mock.Arrange(() => frequency1.Equals(frequency2)).Returns(false); Mock.Arrange(() => frequency2.Equals(frequency1)).Returns(false); var target = new Schedule { DailyFrequency = frequency1 }; var other = new Schedule { DailyFrequency = frequency2 }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentIsActiveAreNotEqual() { var target = new Schedule { IsActive = false }; var other = new Schedule { IsActive = true }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentEndDateAreNotEqual() { var target = new Schedule { EndDate = new DateTime(2013, 1, 16) }; var other = new Schedule { EndDate = new DateTime(2013, 1, 17) }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentNameAreNotEqual() { var target = new Schedule { Name = "Schedule 1" }; var other = new Schedule { Name = "Schedule 2" }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentDescriptionAreNotEqual() { var target = new Schedule { Description = "Description 1" }; var other = new Schedule { Description = "Description 2" }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDifferentGuidAreNotEqual() { var target = new Schedule { Guid = Guid.Parse("{0986C289-50E9-4FBC-AF11-C6BCBDE87276}") }; var other = new Schedule { Guid = Guid.Parse("{FF1E204E-9820-4B00-ABFD-52CAD2D3487B}") }; Assert.IsFalse(target.Equals(other)); }
public void SchedulesWithDefaultValuesAreEqual() { var target = new Schedule(); var other = new Schedule(); Assert.IsTrue(target.Equals(other)); }
public void ScheduleIsNotEqualToRandomObject() { var target = new Schedule(); Assert.IsFalse(target.Equals(new object())); }
public void ScheduleIsEqualToSelf() { var target = new Schedule(); Assert.IsTrue(target.Equals(target)); }
public void ScheduleIsNotEqualToNull() { var target = new Schedule(); Assert.IsFalse(target.Equals(null)); }