public void TestToString()
        {
            IDifference result     = StringDifference.Construct("Foo", null, "bar");
            string      diffString = result.ToString();

            Assert.IsNotNull(diffString);
            AssertOneLiner(diffString);
        }
        public void TestOneNull()
        {
            IDifference result = StringDifference.Construct("Foo", null, "bar");

            Assert.IsNotNull(result);

            result = StringDifference.Construct("Foo", "bar", null);
            Assert.IsNotNull(result);
        }
Beispiel #3
0
        public void TestAddChild()
        {
            DifferenceClass diffClass = new DifferenceClass();

            diffClass.AddChild(StringDifference.Construct("Foo", "Bar1", "Bar2"));
            Assert.AreEqual(1, diffClass.ChildCount());

            diffClass.AddChild(null);
            Assert.AreEqual(1, diffClass.ChildCount());
        }
        public void TestToString()
        {
            ChemObjectDifference diff = new ChemObjectDifference("AtomTypeDiff");
            string diffString         = diff.ToString();

            Assert.IsNotNull(diffString);
            Assert.AreEqual(0, diffString.Length);

            diff.AddChild(StringDifference.Construct("Foo", "bar", "bar1"));
            diffString = diff.ToString();
            Assert.IsNotNull(diffString);
            AssertOneLiner(diffString);
            AssertContains(diffString, "AtomTypeDiff");
            AssertContains(diffString, "{");
            AssertContains(diffString, "}");
        }
Beispiel #5
0
        public void TestChildDiffs()
        {
            DifferenceClass    diffClass = new DifferenceClass();
            List <IDifference> diffs     = new List <IDifference>
            {
                StringDifference.Construct("Foo", "Bar1", "Bar2"),
                IntegerDifference.Construct("Foo", 1, 2)
            };

            diffClass.AddChildren(diffs);
            Assert.AreEqual(2, diffClass.ChildCount());
            var diffs2 = diffClass.GetChildren().GetEnumerator();
            int count  = 0;

            while (diffs2.MoveNext())
            {
                var dummy = diffs2.Current;
                count++;
            }
            Assert.AreEqual(2, count);
        }
        public void TestTwoNull()
        {
            IDifference result = StringDifference.Construct("Foo", null, null);

            Assert.IsNull(result);
        }
        public void TestSame()
        {
            IDifference result = StringDifference.Construct("Foo", "foo", "foo");

            Assert.IsNull(result);
        }
        public void TestDiff()
        {
            IDifference result = StringDifference.Construct("Foo", "foo", "bar");

            Assert.IsNotNull(result);
        }