示例#1
0
        public void RemoveANonExistentParticipantTest()
        {
            personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
            OnlineWks owks = new OnlineWks("An online workshop", "How to give online workshops", DateTime.Now, 3, (Teacher)personlogic.GetPerson("159357"), "somelink");
            Student   stu  = new Student("John", "Smith", "123456");

            personlogic.AddPerson(stu);
            Student stu2 = new Student("John", "Dylan", "128456");

            personlogic.AddPerson(stu2);
            owks.AddParticipant(stu);
            owks.RemoveParticipant(stu2);
        }
示例#2
0
        public void RemoveAParticipantTest()
        {
            personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
            OnlineWks owks = new OnlineWks("An online workshop", "How to give online workshops", DateTime.Now, 3, (Teacher)personlogic.GetPerson("159357"), "somelink");
            Student   stu  = new Student("John", "Smith", "123456");

            personlogic.AddPerson(stu);
            Student stu2 = new Student("John", "Dylan", "128456");

            personlogic.AddPerson(stu2);
            owks.AddParticipant(stu);
            owks.AddParticipant(stu2);
            owks.RemoveParticipant(stu2);
            List <Person> expected = new List <Person>()
            {
                stu
            };

            CollectionAssert.AreEqual(expected, owks.GetParticipants());
        }