Skip to content

Instantly share code, notes, and snippets.

@KevM
Created June 3, 2014 15:27
Show Gist options
  • Select an option

  • Save KevM/bb75705bc6d2c19ec7eb to your computer and use it in GitHub Desktop.

Select an option

Save KevM/bb75705bc6d2c19ec7eb to your computer and use it in GitHub Desktop.
FubuMVC Integration testing
[Test]
public void home_endpoint_should_return_document_specifications()
{
using (var server = new WebApplication().BuildApplication().RunEmbedded())
{
var results = server.Endpoints.Get<HomeEndpoint>(x => x.Execute(new HomeRequest()))
.ReadAsJson<SpecificationListViewModel>();
results.SpecificationDocumentCount.ShouldBeGreaterThan(0);
}
}
@KevM

KevM commented Jun 3, 2014

Copy link
Copy Markdown
Author

Secret sauce to get this working:

ripple install FubuMVC.TestingHarness -p MyProject.Tests
ripple install FubuMVC.StructureMap -p MyProject.Tests

The next trick was figuring out that RunEmbedded() really just wanted my web application's FubuApplication instance (created by my implementation of IFubuApplication.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment