static void AssertNotModified(MySection my, TestLabel label)
 {
     label.EnterScope("modified");
     Assert.That(my, Is.Not.Null, label.Get());
     Assert.That(my.IsModified, Is.False, label.Get());
     Assert.That(my.List, Is.Not.Null, label.Get());
     Assert.That(my.List.Collection.Count, Is.EqualTo(0), label.Get());
     Assert.That(my.List.IsModified, Is.False, label.Get());
     label.LeaveScope();
 }
Esempio n. 2
0
 static void AssertNotModified(MySection my, TestLabel label)
 {
     label.EnterScope("modified");
     Assert.NotNull(my);
     Assert.False(my.IsModified, label.Get());
     Assert.NotNull(my.List);
     Assert.Equal(0, my.List.Collection.Count);
     Assert.False(my.List.IsModified, label.Get());
     label.LeaveScope();
 }
Esempio n. 3
0
        static void AssertListElement(XPathNavigator nav, TestLabel label)
        {
            Assert.True(nav.HasChildren, label.Get());
            var iter = nav.SelectChildren(XPathNodeType.Element);

            Assert.Equal(1, iter.Count);
            Assert.True(iter.MoveNext(), label.Get());

            var my = iter.Current;

            label.EnterScope("my");
            Assert.Equal("my", my.Name);
            Assert.False(my.HasAttributes, label.Get());

            label.EnterScope("children");
            Assert.True(my.HasChildren, label.Get());
            var iter2 = my.SelectChildren(XPathNodeType.Element);

            Assert.Equal(1, iter2.Count);
            Assert.True(iter2.MoveNext(), label.Get());

            var test = iter2.Current;

            label.EnterScope("test");
            Assert.Equal("test", test.Name);
            Assert.False(test.HasChildren, label.Get());
            Assert.True(test.HasAttributes, label.Get());

            var attr = test.GetAttribute("Hello", string.Empty);

            Assert.Equal("29", attr);
            label.LeaveScope();
            label.LeaveScope();
            label.LeaveScope();
        }