public Student(string name, Course course) { this.name = name; this.course = course; }
public void Setup() { printer = TestHelper.CreateTestPrinter(); car = new Car(new SteeringWheel(new FoamGrip("Plastic"))) { Brand = "Toyota" }; course = new Course(); course.Members.Add(new Student("Stan", course)); course.Members.Add(new Student("Richy", course)); }
public void CyclicGraph_xmlstyle() { printer.Configuration.OutputFormatter = new XmlStyle(printer.Configuration); var course = new Course(); course.Members.Add(new Student("Stan", course)); course.Members.Add(new Student("Richy", course)); var expected = @"<Root type='Course' ref='0'> <Members type='List(Student)'> <Element type='Student'> <name>Stan</name> <course ref='0'/> </Element> <Element type='Student'> <name>Richy</name> <course ref='0'/> </Element> </Members> </Root>"; printer.Assert.PrintEquals(expected, course); }