public void ProductServiceFactory_GetHandlersForCommand_WhenCalledWithSelectiveInvoiceCommand_ShouldReturnDiscountService(
            SubmitSelectiveInvoiceDiscountApplicationCommand command,
            Mock <ISelectInvoiceService> selectInvoiceService)
        {
            var collection = new ServiceCollection();

            collection
            .AddSingleton(typeof(ISelectInvoiceService), selectInvoiceService.Object)
            .AddProductServices();

            var resolvedHandler = new ProductServiceFactory(collection.BuildServiceProvider())
                                  .GetHandlerForCommand(command);

            resolvedHandler.Should().BeOfType <SelectiveInvoiceDiscountService>();
        }
Ejemplo n.º 2
0
 public ProductsController()
 {
     service = ProductServiceFactory.CreateProductService();
 }
Ejemplo n.º 3
0
 public ProductController() : this(ProductServiceFactory.Create())
 {
 }