Exemple #1
0
        public void IfProductDoesNotExistShouldReturnErrorResult()
        {
            var nonExistentProduct = new NonExistentProduct();

            AssumeProductDoesNotExist(nonExistentProduct);

            var error = WhenCommandIsHandled <ProductDoesNotExistError>(new AddItemCommand(Guid.NewGuid(),
                                                                                           nonExistentProduct.ProductId));

            Assert.NotNull(error);
        }
Exemple #2
0
 private void AssumeProductDoesNotExist(NonExistentProduct nonExistentProduct)
 {
     productApiStub
     .Setup(x => x.GetProduct(nonExistentProduct.ProductId))
     .Returns((Apis.ProductInfo)null);
 }