示例#1
0
        public void ValidateToErrorResponseOfWithMissingMixRadioHeader()
        {
            var               command  = new MockMusicClientCommand();
            Response          r        = new Response(HttpStatusCode.OK, new Guid(), false);
            Response <object> response = command.ItemErrorResponseHandler <object>(r);

            Assert.IsNotNull(response, "Expected a new Response");
            Assert.IsNull(response.ErrorResponseBody);
            Assert.IsNotNull(response.Error, "Expected an exception");
            Assert.IsInstanceOf <NetworkLimitedException>(response.Error, "Expected a NetworkLimitedException");
            Assert.IsFalse(response.Succeeded, "Expected failure");
            Assert.IsNull(response.Result, "Expected no result");
        }
示例#2
0
        public void ValidateToErrorResponseOfWithMixRadioException()
        {
            var               command  = new MockMusicClientCommand();
            Response          r        = new Response(null, new MixRadioException(null), "ThisIsTheResponseBody", new Guid());
            Response <object> response = command.ItemErrorResponseHandler <object>(r);

            Assert.IsNotNull(response, "Expected a new Response");
            Assert.IsNull(response.StatusCode, "Expected no status code");
            Assert.AreEqual("ThisIsTheResponseBody", response.ErrorResponseBody, "Expected the same error response body");
            Assert.IsNotNull(response.Error, "Expected an exception");
            Assert.AreSame(r.Error, response.Error, "Expected the same exception");
            Assert.IsFalse(response.Succeeded, "Expected failure");
            Assert.IsNull(response.Result, "Expected no result");
        }
示例#3
0
 public void ValidateToErrorResponseOfWithMissingMixRadioHeader()
 {
     var command = new MockMusicClientCommand();
     Response r = new Response(HttpStatusCode.OK, new Guid(), false);
     Response<object> response = command.ItemErrorResponseHandler<object>(r);
     Assert.IsNotNull(response, "Expected a new Response");
     Assert.IsNull(response.ErrorResponseBody);
     Assert.IsNotNull(response.Error, "Expected an exception");
     Assert.IsInstanceOf<NetworkLimitedException>(response.Error, "Expected a NetworkLimitedException");
     Assert.IsFalse(response.Succeeded, "Expected failure");
     Assert.IsNull(response.Result, "Expected no result");
 }
示例#4
0
 public void ValidateToErrorResponseOfWithMixRadioException()
 {
     var command = new MockMusicClientCommand();
     Response r = new Response(null, new MixRadioException(null), "ThisIsTheResponseBody", new Guid());
     Response<object> response = command.ItemErrorResponseHandler<object>(r);
     Assert.IsNotNull(response, "Expected a new Response");
     Assert.IsNull(response.StatusCode, "Expected no status code");
     Assert.AreEqual("ThisIsTheResponseBody", response.ErrorResponseBody, "Expected the same error response body");
     Assert.IsNotNull(response.Error, "Expected an exception");
     Assert.AreSame(r.Error, response.Error, "Expected the same exception");
     Assert.IsFalse(response.Succeeded, "Expected failure");
     Assert.IsNull(response.Result, "Expected no result");
 }