Beispiel #1
0
        private static bool Validate404Response(ZumoTest test, MobileServiceInvalidOperationException msioe)
        {
            test.AddLog("Received expected exception - {0}: {1}", msioe.GetType().FullName, msioe.Message);
            var response = msioe.Response;

            if (response.StatusCode == 404)
            {
                test.AddLog("And error code is the expected one.");
                return(true);
            }
            else
            {
                test.AddLog("Received error code is not the expected one: {0} - {1}", response.StatusCode, response.StatusDescription);
                return(false);
            }
        }
        private bool Validate404Response(MobileServiceInvalidOperationException msioe)
        {
            Log("Received expected exception - {0}: {1}", msioe.GetType().FullName, msioe.Message);
            var response = msioe.Response;

            if (response.StatusCode == HttpStatusCode.NotFound)
            {
                Log("And error code is the expected one.");
                return(true);
            }
            else
            {
                Log("Received error code is not the expected one: {0} - {1}", response.StatusCode, response.ReasonPhrase);
                return(false);
            }
        }