Created
April 25, 2013 08:20
-
-
Save JefClaes/5458289 to your computer and use it in GitHub Desktop.
Also makes for clean controller tests.
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
| [TestClass()] | |
| public class ConfirmationModuleTest | |
| { | |
| private Mock<IBus> _bus; | |
| private Browser _browser; | |
| [TestInitialize] | |
| public void Setup() | |
| { | |
| _bus = new Mock<IBus>(); | |
| var bootstrapper = new ConfigurableBootstrapper(with => | |
| { | |
| with.Module<ConfirmationModule>(); | |
| with.Dependency<IBus>(_bus.Object); | |
| }); | |
| _browser = new Browser(bootstrapper); | |
| } | |
| [TestMethod] | |
| public void Confirm_done_GET_returns_OK() | |
| { | |
| var response = _browser.Get("/confirm/done"); | |
| Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); | |
| } | |
| [TestMethod] | |
| public void Confirm_POST_puts_command_on_bus() | |
| { | |
| var response = _browser.Post("/confirm/565036d3-9bb8-40a1-b353-ab62cdbc51de"); | |
| _bus.Verify(x => x.ExecuteCommand(new ConfirmQueryCommand(Guid.Parse("565036d3-9bb8-40a1-b353-ab62cdbc51de")))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment