[Adapdev-commits] Adapdev/src/Adapdev.Tests/XPath XPathObjectNavigatorTest.cs,1.6,1.7
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2006-03-15 04:34:26
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16961/src/Adapdev.Tests/XPath Modified Files: XPathObjectNavigatorTest.cs Log Message: Index: XPathObjectNavigatorTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/XPath/XPathObjectNavigatorTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XPathObjectNavigatorTest.cs 21 Feb 2006 04:31:17 -0000 1.6 --- XPathObjectNavigatorTest.cs 15 Mar 2006 04:34:20 -0000 1.7 *************** *** 71,74 **** --- 71,104 ---- [Test] + public void TestIListIteration() + { + Product p1 = new Product("egg"); + Product p2 = new Product("Monty Python Flying Circus Box"); + p2.Categories.Add("Silly Stuff"); + + Customer c1 = new Customer("Rodrigo", "Oliveira", new Address("Al. Ribeir�o Preto", 487)); + Customer c2 = new Customer("Marcia", "Longo", new Address("Al. Ribeir�o Preto", 487)); + + Order o1 = new Order(c1); + o1.Add(new OrderItem(p1, 10)); + o1.Add(new OrderItem(p2, 1)); + + Order o2 = new Order(c2); + o2.Add(new OrderItem(p1, 15)); + o2.Add(new OrderItem(p2, 1)); + + Order[] orders = new Order[] { o1, o2 }; + + XPathObjectNavigator navigator = new XPathObjectNavigator(orders, "Orders"); + object[] i = navigator.SelectObjects("//Customer"); + Assert.AreEqual(2, i.Length); + foreach(Customer c in i) + { + Console.WriteLine(c.FirstName); + } + + } + + [Test] public void TestIListProperties() { |