Esempio n. 1
0
        public SemesterEntity GetSemester(Guid semesterId)
        {
            if (semesterId.Equals(Guid.Empty))
            {
                throw new ObjectNotFoundException();
            }

            return(SemesterFactory.Create_SemesterEntity_ValidMinimums(semesterId));
        }
        public void GetSemester_ValidGuid_ReturnsSemester()
        {
            var mockRepo  = new MockRepository <SemesterEntity>();
            var testGuid  = mockRepo.Create(SemesterFactory.Create_SemesterEntity_ValidMinimum());
            var testClass = InteractorFactory.Create_SemesterInteractor(mockRepo);

            var result = testClass.GetSemester(testGuid);

            result.Id.ShouldNotBe(Guid.Empty);
            result.Name.ShouldNotBe(string.Empty);
        }
Esempio n. 3
0
        public void GetSemester_ValidGuid_GetsValidModel()
        {
            var testRepo     = new MockRepository <SemesterEntity>();
            var testSemester = SemesterFactory.Create_SemesterEntity_ValidMinimum();
            var testGuid     = testRepo.Create(testSemester);

            var testClass = ServiceFactory.Create_SemesterService();

            var result = testClass.GetSemester(testGuid);

            result.Name.ShouldNotBe(string.Empty);
        }
        public void GetAllSemsters_ReturnsThreeSemesters()
        {
            var mockRepo = new MockRepository <SemesterEntity>();
            var list     = SemesterFactory.Create_SemesterEntity_ListOfAll();

            foreach (var semester in list)
            {
                mockRepo.Create(semester);
            }

            var testClass = InteractorFactory.Create_SemesterInteractor(mockRepo);

            var result = testClass.GetAllSemesters();

            result.Count.ShouldBe(3);
        }
Esempio n. 5
0
        public void GetAllSemesters_ValidCall_ReturnsThreeSemesters()
        {
            var testRepo      = new MockRepository <SemesterEntity>();
            var testSemesters = SemesterFactory.Create_SemesterEntity_ListOfAll();

            foreach (var semesterEntity in testSemesters)
            {
                testRepo.Create(semesterEntity);
            }

            var testClass = ServiceFactory.Create_SemesterService();

            var result = testClass.GetAllSemesters();

            result.Count.ShouldBe(3);
        }
Esempio n. 6
0
 public List <SemesterEntity> GetAllSemesters()
 {
     return(SemesterFactory.Create_SemesterEntity_ListOfAll());
 }