public void DecodeErrorResponse_WithUuidList() { const string input = @"{""createnetworkresponse"":{""uuidList"":[{""serialVersionUID"":-7514266713085362352,""uuid"":""d308418d-6f76-4320-920f-e362d09ac4b1"",""description"":""networkOfferingId""}],""errorcode"":431,""cserrorcode"":4350,""errortext"":""Can't use specified network offering id as its stat is not Enabled""}}"; APIErrorResult response = CloudStackAPIProxy.DecodeResponse <APIErrorResult>(input); response.ErrorText.ShouldBe("Can't use specified network offering id as its stat is not Enabled"); response.ErrorCode.ShouldBe("431"); response.CloudStackErrorCode.ShouldBe(4350); }
public void DecodeErrorResponse() { const string input = "{\"createaccountresponse\":{\"uuidList\":[],\"errorcode\":431,\"cserrorcode\":9999,\"errortext\":\"Unable to execute API command createaccount due to missing parameter password\"}}"; APIErrorResult response = CloudStackAPIProxy.DecodeResponse <APIErrorResult>(input); response.ErrorText.ShouldBe("Unable to execute API command createaccount due to missing parameter password"); response.ErrorCode.ShouldBe("431"); response.CloudStackErrorCode.ShouldBe(9999); }