public void Navigate() { var source = new TestSource1(); var nav = new NavigableNavigator(source); nav.MoveToRoot(); Assert.AreEqual("", nav.Name); // because we're at root nav.MoveToFirstChild(); Assert.AreEqual("root", nav.Name); nav.MoveToFirstChild(); Assert.AreEqual("type1", nav.Name); // our first content nav.MoveToFirstAttribute(); Assert.AreEqual("id", nav.Name); Assert.AreEqual("1", nav.Value); nav.MoveToNextAttribute(); Assert.AreEqual("prop1", nav.Name); Assert.AreEqual("1:p1", nav.Value); nav.MoveToNextAttribute(); Assert.AreEqual("prop2", nav.Name); Assert.AreEqual("1:p2", nav.Value); Assert.IsFalse(nav.MoveToNextAttribute()); nav.MoveToParent(); nav.MoveToFirstChild(); Assert.AreEqual("prop3", nav.Name); Assert.AreEqual("1:p3", nav.Value); Assert.IsFalse(nav.MoveToNext()); }