Пример #1
0
            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));
            }
Пример #2
0
            public void WhenSourceIsEmptyNode_ResultHasNoChildren()
            {
                var source = CreateListTreeItem();

                var actual = (DifferenceItemContainer)TreeComparer.FromBranchAdded(source);

                Assert.That(actual.Children.Length, Is.Zero);
            }
Пример #3
0
            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));
            }
Пример #4
0
            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));
            }
Пример #5
0
            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));
            }