public void WhenSourceIsNonEmptyNode_ResultHasSameNumberOfChildren() { var source = CreateListTreeItem(CreatePrimitiveTreeItem(1), CreatePrimitiveTreeItem(2)); var actual = (DifferenceItemContainer)TreeComparer.FromBranchAdded(source); Assert.That(actual.Children.Length, Is.EqualTo(2)); }
public void WhenSourceIsEmptyNode_ResultHasNoChildren() { var source = CreateListTreeItem(); var actual = (DifferenceItemContainer)TreeComparer.FromBranchAdded(source); Assert.That(actual.Children.Length, Is.Zero); }
public void WhenSourceIsNode_DifferenceItemContainsCorrectSources() { var source = CreateListTreeItem(); var actual = TreeComparer.FromBranchAdded(source); Assert.That(actual.Current, Is.Null); Assert.That(actual.Next, Is.SameAs(source)); }
public void WhenSourceIsNode_ReturnsDifferenceItemContainerWithAdded() { var source = CreateListTreeItem(); var actual = TreeComparer.FromBranchAdded(source); Assert.That(actual, Is.InstanceOf <DifferenceItemContainer>()); Assert.That(actual.DiffType, Is.EqualTo(DiffType.Added)); }
public void WhenSourceIsPrimitive_ReturnsDifferenceItemWithAdded() { var source = CreatePrimitiveTreeItem(1); var actual = TreeComparer.FromBranchAdded(source); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.Not.InstanceOf <DifferenceItemContainer>()); Assert.That(actual.DiffType, Is.EqualTo(DiffType.Added)); }