Exemplo n.º 1
0
            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));
            }
Exemplo n.º 2
0
            public void WhenSourceIsEmptyNode_ResultHasNoChildren()
            {
                var current = CreateListTreeItem();
                var next    = CreateListTreeItem();

                var actual = (DifferenceItemContainer)TreeComparer.FromBranchModified(current, next);

                Assert.That(actual.Children.Length, Is.Zero);
            }
Exemplo n.º 3
0
            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));
            }
Exemplo n.º 4
0
            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));
            }
Exemplo n.º 5
0
            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));
            }