Last active
August 29, 2015 14:02
-
-
Save MattHoneycutt/9f8bdd2e883d1f6f8c36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SpecsFor; | |
public class OrderProcessorSpecs : SpecsFor<OrderProcessor> | |
{ | |
[Test] | |
public void Order_submitted_successfully_Tests() | |
{ | |
GetMockFor<IInventory>() | |
.Setup(i => i.IsQuantityAvailable("TestPart", 10)) | |
.Returns(true) | |
.Verifiable(); | |
var result = SUT.Process(new Order {PartNumber = "TestPart", Quantity = 10}); | |
result.WasAccepted.ShouldBeTrue(); | |
GetMockFor<IInventory>().Verify(); | |
GetMockFor<IPublisher>() | |
.Verify(p => p.Publish(It.Is<OrderSubmitted>(o => o.OrderNumber == result.OrderNumber))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment