private PutSampleService GetMockedPutSampleService()
        {
            var mockedDefaultDbContext = MockDefaultHelper
                                         .GetMockedDbContext()
                                         .AddMockedSamples();

            var mockedDefaultDbContextQuery = MockDefaultHelper
                                              .GetMockedDbContextQuery()
                                              .AddMockedSamples();

            var mockedSampleValidator = new SampleValidator();

            var mockedSampleNameAlreadyExistsSpecification = new SampleDescriptionAlreadyExistsSpecification(
                mockedDefaultDbContextQuery.Object);

            var mockedPutSampleSpecificationsValidator = new PutSampleSpecificationsValidator(
                mockedSampleNameAlreadyExistsSpecification);

            var mockedPutSampleService = new PutSampleService(
                mockedDefaultDbContext.Object,
                mockedSampleValidator,
                mockedPutSampleSpecificationsValidator);

            return(mockedPutSampleService);
        }
        private DeleteSampleService GetMockedDeleteSampleService()
        {
            var mockedDefaultDbContext = MockDefaultHelper
                                         .GetMockedDbContext()
                                         .AddMockedSamples();

            var mockedSampleValidator = new SampleValidator();

            var mockedDeleteSampleSpecificationsValidator = new DeleteSampleSpecificationsValidator();

            var mockedDeleteSampleService = new DeleteSampleService(
                mockedDefaultDbContext.Object,
                mockedSampleValidator,
                mockedDeleteSampleSpecificationsValidator
                );

            return(mockedDeleteSampleService);
        }
示例#3
0
        private DeleteProductService GetMockedDeleteProductService()
        {
            var mockedDbContext = MockDefaultHelper
                                  .GetMockedDbContext()
                                  .AddMockedProducts();

            var mockedProductValidator = new ProductValidator();

            var mockedDeleteProductSpecificationsValidator = new DeleteProductSpecificationsValidator();

            var mockedDeleteProductService = new DeleteProductService(
                mockedDbContext.Object,
                mockedProductValidator,
                mockedDeleteProductSpecificationsValidator
                );

            return(mockedDeleteProductService);
        }
        private DeleteOrderService GetMockedDeleteOrderService()
        {
            var mockedDbContext = MockDefaultHelper
                                  .GetMockedDbContext()
                                  .AddMockedOrders();

            var mockedOrderValidator = new OrderValidator();

            var mockedDeleteOrderSpecificationsValidator = new DeleteOrderSpecificationsValidator();

            var mockedDeleteOrderService = new DeleteOrderService(
                mockedDbContext.Object,
                mockedOrderValidator,
                mockedDeleteOrderSpecificationsValidator
                );

            return(mockedDeleteOrderService);
        }
        private DeleteCategoryService GetMockedDeleteCategoryService()
        {
            var mockedDbContext = MockDefaultHelper
                                  .GetMockedDbContext()
                                  .AddMockedCategories();

            var mockedCategoryValidator = new CategoryValidator();

            var mockedDeleteCategorySpecificationsValidator = new DeleteCategorySpecificationsValidator();

            var mockedDeleteCategoryService = new DeleteCategoryService(
                mockedDbContext.Object,
                mockedCategoryValidator,
                mockedDeleteCategorySpecificationsValidator
                );

            return(mockedDeleteCategoryService);
        }
        private PutCustomerService GetMockedPutCustomerService()
        {
            var mockedDbContext = MockDefaultHelper
                                  .GetMockedDbContext()
                                  .AddMockedCustomers();

            var mockedDbContextQuery = MockDefaultHelper
                                       .GetMockedDbContext()
                                       .AddMockedCustomers();

            var mockedCustomerValidator = new CustomerValidator();

            var mockedPutCustomerSpecificationsValidator = new PutCustomerSpecificationsValidator();

            var mockedPutCustomerService = new PutCustomerService(
                mockedDbContext.Object,
                mockedCustomerValidator,
                mockedPutCustomerSpecificationsValidator);

            return(mockedPutCustomerService);
        }
        private PutImageService GetMockedPutImageService()
        {
            var mockedDbContext = MockDefaultHelper
                                  .GetMockedDbContext()
                                  .AddMockedImages();

            var mockedDbContextQuery = MockDefaultHelper
                                       .GetMockedDbContext()
                                       .AddMockedImages();

            var mockedImageValidator = new ImageValidator();

            var mockedPutImageSpecificationsValidator = new PutImageSpecificationsValidator();

            var mockedPutImageService = new PutImageService(
                mockedDbContext.Object,
                mockedImageValidator,
                mockedPutImageSpecificationsValidator);

            return(mockedPutImageService);
        }