public void WhenSourceIsNonEmptyNode_ResultHasSameNumberOfChildren() { var current = CreateListTreeItem(); var next = CreateListTreeItem(CreatePrimitiveTreeItem(5), CreatePrimitiveTreeItem("alfa")); var actual = (DifferenceItemContainer)TreeComparer.FromBranchModified(current, next); Assert.That(actual.Children.Length, Is.EqualTo(2)); }
public void WhenSourceIsEmptyNode_ResultHasNoChildren() { var current = CreateListTreeItem(); var next = CreateListTreeItem(); var actual = (DifferenceItemContainer)TreeComparer.FromBranchModified(current, next); Assert.That(actual.Children.Length, Is.Zero); }
public void WhenSourceIsNode_DifferenceItemContainsCorrectSources() { var current = CreateListTreeItem(); var next = CreateListTreeItem(CreatePrimitiveTreeItem(5), CreatePrimitiveTreeItem("alfa")); var actual = TreeComparer.FromBranchModified(current, next); Assert.That(actual.Current, Is.SameAs(current)); Assert.That(actual.Next, Is.SameAs(next)); }
public void WhenSourceIsNode_ReturnsDifferenceItemContainerWithNone() { var current = CreateListTreeItem(); var next = CreateListTreeItem(); var actual = TreeComparer.FromBranchModified(current, next); Assert.That(actual, Is.InstanceOf <DifferenceItemContainer>()); Assert.That(actual.DiffType, Is.EqualTo(DiffType.None)); }
public void WhenSourceIsPrimitive_ReturnsDifferenceItemWithNone() { var current = CreatePrimitiveTreeItem(1); var next = CreatePrimitiveTreeItem(2); var actual = TreeComparer.FromBranchModified(current, next); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.Not.InstanceOf <DifferenceItemContainer>()); Assert.That(actual.DiffType, Is.EqualTo(DiffType.None)); }