Пример #1
0
        public HomeModule()
        {
            Get["/"] = _ =>
                {
                    var quip = new Quip("Hello World!");

                    return quip;
                };
        }
Пример #2
0
        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);
        }
Пример #3
0
        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");
        }
Пример #4
0
 public ContentNegotiationTests()
 {
     testData = new Quip { Message = "Fixed some errors in the last commit" };
 }