コード例 #1
0
 public PutSchoolService(
     IDefaultDbContext context,
     SchoolValidator entityValidator,
     PutSchoolSpecificationsValidator domainValidator
     ) : base(entityValidator, domainValidator)
 {
     Context = context;
 }
コード例 #2
0
        private PutSchoolService GetMockedPutSchoolService()
        {
            var mockedDefaultDbContext      = MockDefaultHelper.GetMockedDefaultDbContext();
            var mockedDefaultDbContextQuery = MockDefaultHelper.GetMockedDefaultDbContextQuery();

            var mockedSchoolValidator = new SchoolValidator();

            var mockedSchoolNameAlreadyExistsSpecification = new SchoolNameAlreadyExistsSpecification(
                mockedDefaultDbContextQuery.Object);

            var mockedPutSchoolSpecificationsValidator = new PutSchoolSpecificationsValidator(
                mockedSchoolNameAlreadyExistsSpecification);

            var mockedPutSchoolService = new PutSchoolService(
                mockedDefaultDbContext.Object,
                mockedSchoolValidator,
                mockedPutSchoolSpecificationsValidator);

            return(mockedPutSchoolService);
        }