public Student(string name, Course course)
 {
     this.name   = name;
     this.course = course;
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public Student(string name, Course course)
 {
     this.name = name;
     this.course = course;
 }
Esempio n. 4
0
        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);
        }