public void TestErrorResponse()
        {
            string str = "{\"errorCode\":1,\"message\":\"The requested resource could not be found.\",\"errors\":[{\"errorCode\":1,\"description\":\"The requested resource could not be found.\"}],\"trackingId\":\"xyz\"}";

            var spaces = SparkObject.FromJsonString <SpaceList>(str);

            var errors = spaces.GetErrors();

            Assert.AreEqual(1, errors[0].ErrorCode);
            Assert.AreEqual("The requested resource could not be found.", errors[0].Description);
        }
        public void TestPartialErrorResponse()
        {
            string str = "{\"items\":[{\"id\":\"id01\",\"title\":\"title01\",\"type\":\"group\",\"isLocked\":true,\"teamId\":\"teamid01\",\"lastActivity\":\"2016-04-21T19:12:48.920Z\",\"created\":\"2016-04-21T19:01:55.966Z\"},{\"id\":\"id02\",\"title\":\"xyz...\",\"errors\":{\"title\":{\"code\":\"kms_failure\",\"reason\":\"Key management server failed to respond appropriately. For more information: https://developer.ciscospark.com/errors.html\"}}}]}";

            var spaces = SparkObject.FromJsonString <SpaceList>(str);

            var space = spaces.Items[1];

            var errors = space.GetPartialErrors();

            Assert.IsTrue(errors.ContainsKey("title"));
            Assert.AreEqual(PartialErrorCode.KMSFailure, errors["title"].Code);
            Assert.AreEqual("Key management server failed to respond appropriately. For more information: https://developer.ciscospark.com/errors.html", errors["title"].Reason);
        }