public async Task Should_UpdateStockProduct_When_MerchantProductExist(string no1, string no2) { topSoldProductServiceMock.GetOrderTopSoldProducts(LineFactory.CreateLines( LineFactory.CreateLine(no1), LineFactory.CreateLine(no2) )); var handler = new UpdateStockCommandHandler(topSoldProductServiceMock.Object, dataSourceMock.Object); await handler.Handle(new UpdateStockCommand(no2), CancellationToken.None); }
public async Task Should_FillProductsNames(string no1, string no2, string no3, string no4, string no5, string no6) { dataSourceMock.GetProductsAsyncMock(ProductFactory.CreateProducts(no1, no2, no3, no4, no5, no6)); topSoldProductServiceMock.GetOrderTopSoldProducts(LineFactory.CreateLines( LineFactory.CreateLine(no1), LineFactory.CreateLine(no2), LineFactory.CreateLine(no3), LineFactory.CreateLine(no4), LineFactory.CreateLine(no5) )); var handler = new GetTopSoldProductsQueryHandler(dataSourceMock.Object, topSoldProductServiceMock.Object); var products = await handler.Handle(new GetTopSoldProductsQuery(), CancellationToken.None); Assert.All(products, x => Assert.NotNull(x.Name)); }