コード例 #1
0
        private IResult <StudentDetails> Update_StudentFound(StudentDetails studentDetails)
        {
            // Arrange
            var student = StudentsRepository.FoundEntity();

            studentDetails.Id = student.Id;

            //Act
            var result = _service.Update(studentDetails);

            return(result);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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
            });
        }
コード例 #5
0
        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
            });
        }