Example #1
0
        public static void DoctorBillTriesToPostToSomebodyElsesBlogAndFails()
        {
            "Given I am logged in as Dr. Bill"
            .Given(() => Site.Login("Dr. Bill", "oranges"));

            "When I try to post to \"Greg's anti-tax rants\""
            .When(() => Blogs.Get("Greg's anti-tax rants").Post(new Article {
                Body = "This is a great blog!"
            }));

            "Then I should see \"Hey! That's not your blog!\""
            .Then(() => Site.CurrentPage.Body.Should().Contain("Hey! That's not your blog!"));
        }
Example #2
0
        public static void GregPostsToAClientBlog()
        {
            "Given I am logged in as Greg"
            .Given(() => Site.Login("Greg", "apples"));

            "When I try to post to \"Expensive Therapy\""
            .When(() => Blogs.Get("Expensive Therapy").Post(new Article {
                Body = "This is a great blog!"
            }));

            "Then I should see \"Your article was published.\""
            .Then(() => Site.CurrentPage.Body.Should().Contain("Your article was published."));
        }
Example #3
0
        public static void DoctorBillPostsToHisOwnBlog()
        {
            "Given I am logged in as Dr. Bill"
            .Given(() => Site.Login("Dr. Bill", "oranges"));

            "When I try to post to \"Expensive Therapy\""
            .When(() => Blogs.Get("Expensive Therapy").Post(new Article {
                Body = "This is a great blog!"
            }));

            "Then I should see \"Your article was published.\""
            .Then(() => Site.CurrentPage.Body.Should().Contain("Your article was published."));
        }