public void Product_GetBySku_Empty() { // Arrange var notificator = new Mock <INotificator>(); var productRepository = new Mock <IProductRepository>(); var productApplication = new ProductApplication(notificator.Object, productRepository.Object); var productFake = NewProduct(); // Act var products = productApplication.GetBySku(productFake.Sku); // Assert Assert.True(products is null); }
public void Product_GetBySku_Any() { // Arrange var notificator = new Mock <INotificator>(); var productRepository = new Mock <IProductRepository>(); var productApplication = new ProductApplication(notificator.Object, productRepository.Object); var productFake = NewProduct(); productRepository.Setup(x => x.GetBySku(productFake.Sku)).Returns(productFake); // Act var products = productApplication.GetBySku(productFake.Sku); // Assert Assert.False(products is null); }