示例#1
0
        private DeleteClassService GetMockedDeleteClassService()
        {
            var mockedDefaultDbContext = MockDefaultHelper.GetMockedDefaultDbContext();

            var mockedClassValidator = new ClassValidator();

            var mockedDeleteClassSpecificationsValidator = new DeleteClassSpecificationsValidator();

            var mockedDeleteClassService = new DeleteClassService(
                mockedDefaultDbContext.Object,
                mockedClassValidator,
                mockedDeleteClassSpecificationsValidator);

            return(mockedDeleteClassService);
        }
        private PostSchoolService GetMockedPostSchoolService()
        {
            var mockedDefaultDbContext      = MockDefaultHelper.GetMockedDefaultDbContext();
            var mockedDefaultDbContextQuery = MockDefaultHelper.GetMockedDefaultDbContextQuery();

            var mockedSchoolValidator = new SchoolValidator();

            var mockedSchoolNameAlreadyExistsSpecification = new SchoolNameAlreadyExistsSpecification(
                mockedDefaultDbContextQuery.Object);

            var mockedPostSchoolSpecificationsValidator = new PostSchoolSpecificationsValidator(
                mockedSchoolNameAlreadyExistsSpecification);

            var mockedPostSchoolService = new PostSchoolService(
                mockedDefaultDbContext.Object,
                mockedSchoolValidator,
                mockedPostSchoolSpecificationsValidator);

            return(mockedPostSchoolService);
        }
        private PatchClassService GetMockedPatchClassService()
        {
            var mockedDefaultDbContext      = MockDefaultHelper.GetMockedDefaultDbContext();
            var mockedDefaultDbContextQuery = MockDefaultHelper.GetMockedDefaultDbContextQuery();

            var mockedClassValidator = new ClassValidator();

            var mockedClassNameAlreadyExistsSpecification = new ClassNameAlreadyExistsSpecification(
                mockedDefaultDbContextQuery.Object);
            var mockedClassCodeAlreadyExistsSpecification = new ClassCodeAlreadyExistsSpecification(
                mockedDefaultDbContextQuery.Object);

            var mockedPatchClassSpecificationsValidator = new PatchClassSpecificationsValidator(
                mockedClassNameAlreadyExistsSpecification,
                mockedClassCodeAlreadyExistsSpecification);

            var mockedPatchClassService = new PatchClassService(
                mockedDefaultDbContext.Object,
                mockedClassValidator,
                mockedPatchClassSpecificationsValidator);

            return(mockedPatchClassService);
        }