public async Task Test_TraktCheckinPostErrorResponse_From_Json()
        {
            var jsonReader           = new CheckinPostErrorResponseObjectJsonReader();
            var checkinErrorResponse = await jsonReader.ReadObjectAsync(JSON) as TraktCheckinPostErrorResponse;

            checkinErrorResponse.Should().NotBeNull();
            checkinErrorResponse.ExpiresAt.Should().Be(DateTime.Parse("2016-04-01T12:44:40Z").ToUniversalTime());
        }
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            var checkinErrorResponse = await jsonReader.ReadObjectAsync(default(Stream));

            checkinErrorResponse.Should().BeNull();
        }
Esempio n. 3
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            var checkinErrorResponse = await jsonReader.ReadObjectAsync(string.Empty);

            checkinErrorResponse.Should().BeNull();
        }
Esempio n. 4
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new CheckinPostErrorResponseObjectJsonReader();

            var checkinErrorResponse = await traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            checkinErrorResponse.Should().BeNull();
        }
Esempio n. 5
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Json_String_Not_Valid()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            var checkinErrorResponse = await jsonReader.ReadObjectAsync(JSON_NOT_VALID);

            checkinErrorResponse.Should().NotBeNull();
            checkinErrorResponse.ExpiresAt.Should().BeNull();
        }
Esempio n. 6
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Json_String_Complete()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            var checkinErrorResponse = await jsonReader.ReadObjectAsync(JSON_COMPLETE);

            checkinErrorResponse.Should().NotBeNull();
            checkinErrorResponse.ExpiresAt.Should().Be(DateTime.Parse("2016-04-01T12:44:40Z").ToUniversalTime());
        }
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var checkinErrorResponse = await jsonReader.ReadObjectAsync(stream);

                checkinErrorResponse.Should().BeNull();
            }
        }
Esempio n. 8
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new CheckinPostErrorResponseObjectJsonReader();

            using (var reader = new StringReader(string.Empty))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var checkinErrorResponse = await traktJsonReader.ReadObjectAsync(jsonReader);

                    checkinErrorResponse.Should().BeNull();
                }
        }
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var checkinErrorResponse = await jsonReader.ReadObjectAsync(stream);

                checkinErrorResponse.Should().NotBeNull();
                checkinErrorResponse.ExpiresAt.Should().BeNull();
            }
        }
Esempio n. 10
0
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_JsonReader_Not_Valid()
        {
            var traktJsonReader = new CheckinPostErrorResponseObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var checkinErrorResponse = await traktJsonReader.ReadObjectAsync(jsonReader);

                    checkinErrorResponse.Should().NotBeNull();
                    checkinErrorResponse.ExpiresAt.Should().BeNull();
                }
        }
Esempio n. 11
0
        public void Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new CheckinPostErrorResponseObjectJsonReader();
            Func <Task <ITraktCheckinPostErrorResponse> > checkinErrorResponse = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            checkinErrorResponse.Should().Throw <ArgumentNullException>();
        }
Esempio n. 12
0
 public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var jsonReader = new CheckinPostErrorResponseObjectJsonReader();
     Func <Task <ITraktCheckinPostErrorResponse> > checkinErrorResponse = () => jsonReader.ReadObjectAsync(default(Stream));
     await checkinErrorResponse.Should().ThrowAsync <ArgumentNullException>();
 }