Skip to content

Instantly share code, notes, and snippets.

@derwolfe
Created August 1, 2013 16:26
Show Gist options
  • Save derwolfe/6132962 to your computer and use it in GitHub Desktop.
Save derwolfe/6132962 to your computer and use it in GitHub Desktop.
using Nancy;
using Nancy.Testing;
using Xunit;
using df_nancy.Modules.api;
namespace df_tests.ApiTests
{
public class PositionApiTests
{
[Fact]
public void Visits_root_successfully()
{
// given
var bootstrapper = new ConfigurableBootstrapper(with =>
{
with.Module<PositionsApi>() // how to pass in the data dependency?
});
// need to add a fake/mock for _positionsData and GetAll();
var browser = new Browser(bootstrapper);
// when
var result = browser.Get("/api/positions/current", with =>
{
with.HttpRequest();
});
// then
// can't find the template
Assert.Equal(HttpStatusCode.OK, result.StatusCode);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment