Ejemplo n.º 1
0
            public void WhenSameSourceSamePropertySameValue_ReturnsNull()
            {
                var source  = new PrimitiveData("tn", 1);
                var current = new PrimitiveObjectTreeItem(source.Value, null, "pn", source);
                var next    = new PrimitiveObjectTreeItem(source.Value, null, "pn", source);

                var actual = TreeComparer.FromPrimitive(current, next);

                Assert.That(actual, Is.Null);
            }
Ejemplo n.º 2
0
            public void WhenDifferentSourceSamePropertyDifferentValue_DifferenceItemIsMarkedAsModified()
            {
                var currentSource = new PrimitiveData("tn", 1);
                var nextSource    = new PrimitiveData("tn", 2);
                var current       = new PrimitiveObjectTreeItem(currentSource.Value, null, "pn", currentSource);
                var next          = new PrimitiveObjectTreeItem(nextSource.Value, null, "pn", nextSource);

                var actual = TreeComparer.FromPrimitive(current, next);

                Assert.That(actual.DiffType, Is.EqualTo(DiffType.Modified));
            }
Ejemplo n.º 3
0
            public void WhenDifferentSourceSamePropertyDifferentValue_ReturnsDifferenceItem()
            {
                var currentSource = new PrimitiveData("tn", 1);
                var nextSource    = new PrimitiveData("tn", 2);
                var current       = new PrimitiveObjectTreeItem(currentSource.Value, null, "pn", currentSource);
                var next          = new PrimitiveObjectTreeItem(nextSource.Value, null, "pn", nextSource);

                var actual = TreeComparer.FromPrimitive(current, next);

                Assert.That(actual, Is.Not.Null);
            }
Ejemplo n.º 4
0
            public void WhenDifferentSourceSamePropertyDifferentValue_DifferenceItemContainsBothItems()
            {
                var currentSource = new PrimitiveData("tn", 1);
                var nextSource    = new PrimitiveData("tn", 2);
                var current       = new PrimitiveObjectTreeItem(currentSource.Value, null, "pn", currentSource);
                var next          = new PrimitiveObjectTreeItem(nextSource.Value, null, "pn", nextSource);

                var actual = TreeComparer.FromPrimitive(current, next);

                Assert.That(actual.Current, Is.SameAs(current));
                Assert.That(actual.Next, Is.SameAs(next));
            }