//This test data is modified from MS-PL Clay project http://clay.codeplex.com public void TestFactoryListSyntax() { dynamic New = Builder.New(); //Test using Clay Syntax var people = New.Array( New.Person().FirstName("Louis").LastName("Dejardin"), New.Person().FirstName("Bertrand").LastName("Le Roy") ); Assert.AreEqual("Dejardin", people[0].LastName); Assert.AreEqual("Le Roy", people[1].LastName); var people2 = new DynamicObjects.List() { New.Robot(Name: "Bender"), New.Robot(Name: "RobotDevil") }; Assert.AreEqual("Bender", people2[0].Name); Assert.AreEqual("RobotDevil", people2[1].Name); }
public void TestFactoryListSyntax() { dynamic New = Builder.New(); //Test using Clay Syntax var people = New.Array( New.Person().FirstName("Louis").LastName("Dejardin"), New.Person().FirstName("Bertrand").LastName("Le Roy") ); Assert.AreEqual("Dejardin", people[0].LastName); Assert.AreEqual("Le Roy", people[1].LastName); var people2 = new DynamicObjects.List() { New.Robot(Name: "Bender"), New.Robot(Name: "RobotDevil") }; Assert.AreEqual("Bender", people2[0].Name); Assert.AreEqual("RobotDevil", people2[1].Name); }