public void FrontEndServiceShouldStorePersonCreatedEvents() { // Arrance var dbset = new DummyDbSet <Person>(); var context = new DummyFrontEndContext(dbset); var service = new FrontEndService(context); // Act service.Execute(new PersonCreated { }); // Assert Assert.True(dbset.AddIsCalled); Assert.True(context.SaveChangedIsCalled); }
public void FrontEndServiceShouldStorePersonCreatedEventsWithMoq() { // Arrange var dbset = Substitute.For <DbSet <Person> >(); var context = Substitute.For <IFrontEndContext>(); context.People.Returns(dbset); var service = new FrontEndService(context); // Act service.Execute(new PersonCreated { }); // Assert dbset.Received(1).Add(Arg.Any <Person>()); context.Received(1).SaveChanges(); }
public SliExportTask( ISettingService settingService, IManufacturerService manufacturerService, IUrlRecordService urlRecordService, IStoreMappingService storeMappingService, IPriceCalculationService priceCalcService, ICategoryService categoryService, IPictureService pictureService, ICustomerService customerService, IRepository <ProductAbcDescription> productAbcDescriptionRepository, IRepository <Product> productRepository, IRepository <ProductCartPrice> productCartPriceRepository, ILogger logger, INopDataProvider nopDbContext, MediaSettings mediaSettings, FrontEndService frontendService, ISpecificationAttributeService specificationAttributeService, IStoreService storeService, IAbcPromoService abcPromoService, SliExportSettings sliExportSettings ) { _settingService = settingService; _manufacturerService = manufacturerService; _urlRecordService = urlRecordService; _storeMappingService = storeMappingService; _priceCalculationService = priceCalcService; _categoryService = categoryService; _pictureService = pictureService; _customerService = customerService; _productAbcDescriptionRepository = productAbcDescriptionRepository; _productRepository = productRepository; _productCartPriceRepository = productCartPriceRepository; _logger = logger; _nopDbContext = nopDbContext; _mediaSettings = mediaSettings; _settings = sliExportSettings; _frontendService = frontendService; _specificationAttributeService = specificationAttributeService; _storeService = storeService; _abcPromoService = abcPromoService; }