Beispiel #1
0
        private TResponse GetWithoutErrorFromJson <TResponse>(string json) where TResponse : IDeezerObjectResponse
        {
            var subject = new DeezerObjectResponseJsonDeserializer();

            var response = JsonConvert.DeserializeObject <TResponse>(json, subject);

            Assert.NotNull(response);

            Assert.IsNull(response.Error);

            return(response);
        }
Beispiel #2
0
        private TResponse GetWithErrorFromJson <TResponse>(string json, string expectedError, int expectedErrorCode) where TResponse : IDeezerObjectResponse
        {
            var subject = new DeezerObjectResponseJsonDeserializer();

            var response = JsonConvert.DeserializeObject <TResponse>(json, subject);

            Assert.NotNull(response);

            Assert.NotNull(response.Error);

            Assert.AreEqual(expectedError, response.Error.Type);
            Assert.AreEqual(expectedErrorCode, response.Error.Code);

            return(response);
        }