public void IfProductDoesNotExistShouldReturnErrorResult() { var nonExistentProduct = new NonExistentProduct(); AssumeProductDoesNotExist(nonExistentProduct); var error = WhenCommandIsHandled <ProductDoesNotExistError>(new AddItemCommand(Guid.NewGuid(), nonExistentProduct.ProductId)); Assert.NotNull(error); }
private void AssumeProductDoesNotExist(NonExistentProduct nonExistentProduct) { productApiStub .Setup(x => x.GetProduct(nonExistentProduct.ProductId)) .Returns((Apis.ProductInfo)null); }