public void Test_AddCourse_AddsCourseToStudent() { //Arrange Student testStudent = new Student("Jasper", "07/24/2017"); testStudent.Save(); Course testCourse = new Course("Intro to CS"); testCourse.Save(); //Act testStudent.AddCourse(testCourse); List <Course> result = testStudent.GetCourses(); List <Course> testList = new List <Course> { testCourse }; //Assert Assert.Equal(testList, result); }
public void Test_Delete_DeletesCourseAssociationsFromDatabase() { //Arrange Student testStudent = new Student("Jasper", "07/24/2017"); testStudent.Save(); string testName = "Accounting"; Course testCourse = new Course(testName); testCourse.Save(); //Act testCourse.AddStudent(testStudent); testCourse.Delete(); List <Course> resultStudentCourses = testStudent.GetCourses(); List <Course> testStudentCourses = new List <Course> { }; //Assert Assert.Equal(testStudentCourses, resultStudentCourses); }