public void ItemComparison_TargetButNoSource_CorrectProperties() { // Arrange var item2 = new MyTestClass1() { Id = 2, Description = "Two" }; // Act var itemComparison = ItemComparison <MyTestClass1, MyTestClass1> .Create(null, item2); // Assert itemComparison.Source.ShouldBeNull(); item2.ShouldBeSameAs(itemComparison.Target); itemComparison.Matched.ShouldBeFalse(); itemComparison.SourceOnly.ShouldBeFalse(); itemComparison.TargetOnly.ShouldBeTrue(); }
public void ItemComparison_SourceButNoTarget_CorrectProperties() { // Arrange var item1 = new MyTestClass1() { Id = 1, Description = "One" }; // Act var itemComparison = ItemComparison <MyTestClass1, MyTestClass1> .Create(item1, null); // Assert item1.ShouldBeSameAs(itemComparison.Source); itemComparison.Target.ShouldBeNull(); itemComparison.Matched.ShouldBeFalse(); itemComparison.SourceOnly.ShouldBeTrue(); itemComparison.TargetOnly.ShouldBeFalse(); }