daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [Test]
  2. public void Invalid_Credit_Card_Cancels_Order()
  3. {
  4.     var mockProcessor = A.Fake<IProcessor>();
  5.     A.CallTo(() => mockProcessor.Validate("12345")).Returns(false);
  6.     var cart = new ShoppingCart(mockProcessor);
  7.  
  8.     cart.Checkout("12345");
  9.  
  10.     Assert.That(cart.PaymentAccepted, Is.EqualTo(false));
  11.     A.CallTo(() => mockProcessor.Validate("12345")).MustHaveHappened(Repeated.Once.Exactly);  
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top