public void UpdateCourse_NewObject_ThrowsObjectNotFound() { var testClass = InteractorFactory.Create_CourseInteractor(); var testScore = CourseFactory.Create_CourseEntity_ValidMinimum(); Should.Throw <ObjectNotFoundException>(() => testClass.UpdateCourse(testScore)); }
public CourseEntity GetCourse(Guid courseId) { if (courseId.Equals(Guid.Empty)) { throw new ObjectNotFoundException(); } return(CourseFactory.Create_CourseEntity_ValidMinimum(courseId)); }
public void CreateCourse_ValidModel_ResultNotNull() { var testClass = InteractorFactory.Create_CourseInteractor(); var testModel = CourseFactory.Create_CourseEntity_ValidMinimum(); var result = testClass.CreateCourse(testModel); result.ShouldNotBeNull(); }
public void UpdateCourse_ValidModel_ReturnsValidModel() { var testCourseId = Guid.NewGuid(); var testCourseEntity = CourseFactory.Create_CourseEntity_ValidMinimum(testCourseId); var testCourseModel = new CreateOrEditCourseDomainModel(testCourseEntity); var testClass = ServiceFactory.Create_MockInteractor(); var result = testClass.UpdateCourse(testCourseModel); result.GetType().ShouldNotBe(typeof(ErrorDomainModel)); }
public void GetCourse_ValidModel_ResultNotNull() { var testRepo = new MockRepository <CourseEntity>(); var testCourse = CourseFactory.Create_CourseEntity_ValidMinimum(); var testGuid = testRepo.Create(testCourse); var testClass = InteractorFactory.Create_CourseInteractor(testRepo); var result = testClass.GetCourse(testGuid); result.Name.ShouldNotBe(string.Empty); }