Exemplo n.º 1
0
        public void StartNewSession_throws_on_unknown_status()
        {
            var http = MakeJsonHttp(JsonHttpClientTest.SetupGet("{'status': 'unknown'}"));

            Assert.That(() => Client.StartNewSession(TestData.ClientInfo, http),
                        ExceptionsTest.ThrowsInvalidResponseWithMessage("'unknown'")
                        .And.Message.StartsWith("Failed to start a new session"));
        }
Exemplo n.º 2
0
        public void StartNewSession_throws_on_invalid_json()
        {
            var jsonHttp = new JsonHttpClient(
                JsonHttpClientTest.SetupGet("} invalid json {").Object,
                "");

            Assert.That(() => Client.StartNewSession(TestData.ClientInfo, jsonHttp),
                        ExceptionsTest.ThrowsInvalidResponseWithMessage("Invalid JSON"));
        }