コード例 #1
0
        public void ExpectAddStudentToSchoolToThrowWhenAddingADuplicatedID()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);
            var willy = new Student("Willy", 10000);

            school.AddStudent(billy);
            school.AddStudent(willy);
        }
コード例 #2
0
        public void ExpectAddingStudentsToSchoolToAddThemCorrectly()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);

            school.AddStudent(billy);
            Assert.AreEqual(school.Students[0], billy, "Expect the add method to add valid students correctly");
        }
コード例 #3
0
        public void ExpectRemoveStudentInSchoolToRemoveAnAddedStudent()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);
            school.AddStudent(billy);
            school.RemoveStudent(billy);

            Assert.AreEqual(school.Students.Count, 0, "Expects the students list to be empty");
        }
コード例 #4
0
 public void ExpectAddStudentToSchoolToThrowWhenAddingANullValue()
 {
     var school = new School();
     school.AddStudent(null);
 }