public void Is_CampaignRepository_CreateCampaign_Return_CampaignInfo(string name, string code, int duration, int limit, int tsCount, int expectedResult) { TestStartup.ConfigureServices(); var repository = TestStartup.ServiceProvider.GetService <ICampaignRepository>(); var campaign = new Campaign { Name = name, ProductCode = code, Duration = duration, Limit = limit, TargetSalesCount = tsCount, Active = true, Turnover = 0, StartDate = DateTime.Now, EndDate = DateTime.Now.AddHours(6), TotalSales = 0, AverageItemPrice = 0, CampaignProductPrice = 0 }; var result = repository.AddCampaign(campaign); Assert.NotEqual(expectedResult, result.Id); TestStartup.DisposeServices(); }
public void Is_CampaignService_CreateCampaign_Return_CampaignInfo(string command, string expectedResult) { TestStartup.ConfigureServices(); var service = TestStartup.ServiceProvider.GetService <ICampaignService>(); var result = service.CreateCampaign(command.Split(' ')); Assert.NotEqual(expectedResult, result); TestStartup.DisposeServices(); }
public void Is_ProductService_CreateProduct_Return_ProductInfo(string command, string expectedResult) { TestStartup.ConfigureServices(); var service = TestStartup.ServiceProvider.GetService <IProductService>(); var result = service.CreateProduct(command.Split(' ')); Assert.Equal(expectedResult, result); TestStartup.DisposeServices(); }
public void Is_ProductRepository_CreateProduct_Return_ProductInfo(string code, int price, int stock, int expectedResult) { TestStartup.ConfigureServices(); var repository = TestStartup.ServiceProvider.GetService <IProductRepository>(); var product = new Product { ProductCode = code, Price = price, Stock = stock }; var result = repository.AddProduct(product); Assert.NotEqual(expectedResult, result.Id); TestStartup.DisposeServices(); }