private IResult <StudentDetails> Update_StudentFound(StudentDetails studentDetails) { // Arrange var student = StudentsRepository.FoundEntity(); studentDetails.Id = student.Id; //Act var result = _service.Update(studentDetails); return(result); }
public void Enrol_CourseIdIsEmpty_Fail() { // Arrange var courseId = Guid.Empty; var student = StudentsRepository.FoundEntity(); // Act var result = _service.Enrol(student.Id, courseId); // Assert Assert.That(result, Is.Not.Null); Assert.That(result.Succeed, Is.False); }
public void RemoveStudentFromCourse_StudentNotInCourse_Fail() { // Arrange var course = CoursesRepository.FoundEntity(); var student = StudentsRepository.FoundEntity(); // Act var result = _service.RemoveStudentFromCourse(student.Id, course.Id); // Assert Assert.That(result, Is.Not.Null); Assert.That(result.Succeed, Is.False); }
private dynamic Enrol_BothFound() { // Arrange var course = CoursesRepository.FoundEntity(); var student = StudentsRepository.FoundEntity(); // Act var result = _service.Enrol(student.Id, course.Id); return(new { Result = result, Course = course, Student = student }); }
private dynamic RemoveStudentFromCourse_CourseFoundAndStudentInCourse() { // Arrange var course = CoursesRepository.FoundEntity(); var student = StudentsRepository.FoundEntity(); course.AddStudent(student); // Act var result = _service.RemoveStudentFromCourse(student.Id, course.Id); return(new { Result = result, Course = course, Student = student }); }