Beispiel #1
0
        public void should_return_null_when_server_is_unavailable()
        {
            IRequestProxy requestProxy = new RequestProxy("http://localhost:9999");
            Scenario.StartNew(this, scenario =>
            {
                scenario.Given("Hudson server is down");

                scenario.When("trying to fetch root");

                scenario.Then("an empty root object will be returned", () =>
                {
                    Root root = requestProxy.Execute<Root>("api/json");
                    root.ShouldBeNull();
                });
            });
        }