public HomeModule() { Get["/"] = _ => { var quip = new Quip("Hello World!"); return quip; }; }
public void can_get_an_awesome_commit_message() { var sut = new Browser(new Bootstrapper { DataStore = DataStoreForTest }); var aFunnyMessage = new Quip { Message = "By works, I meant 'doesnt work'. Works now.." }; var result = sut.Post("/quips", with => with.JsonBody(aFunnyMessage)) .Then.Get("/"); result.Body["#totally_useful_commit_message"].ShouldExistOnce().And.ShouldContain("works now", StringComparison.InvariantCultureIgnoreCase); }
public void can_persist_a_funny_commit_message() { var sut = new Browser(new Bootstrapper { DataStore = DataStoreForTest }); var aFunnyMessage = new Quip { Message = "Fixed some bad code" }; var result = sut.Post("/quips", with => { with.JsonBody(aFunnyMessage); with.Accept("application/json"); }); result.StatusCode.ShouldBe(HttpStatusCode.Created); var returnedQuip = result.Body.DeserializeJson<Quip>(); returnedQuip.Id.ShouldBe("quips/1"); }
public ContentNegotiationTests() { testData = new Quip { Message = "Fixed some errors in the last commit" }; }