public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var reader = new StringReader(JSON_NOT_VALID_3)) using (var jsonReader = new JsonTextReader(reader)) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(jsonReader); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().Be(2); traktSeasonWatchedProgress.Aired.Should().Be(3); traktSeasonWatchedProgress.Completed.Should().BeNull(); traktSeasonWatchedProgress.Episodes.Should().NotBeNull().And.HaveCount(2); var episodesWatchedProgress = traktSeasonWatchedProgress.Episodes.ToArray(); episodesWatchedProgress[0].Should().NotBeNull(); episodesWatchedProgress[0].Number.Should().Be(1); episodesWatchedProgress[0].Completed.Should().BeTrue(); episodesWatchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); episodesWatchedProgress[1].Should().NotBeNull(); episodesWatchedProgress[1].Number.Should().Be(2); episodesWatchedProgress[1].Completed.Should().BeTrue(); episodesWatchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime()); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_2() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var stream = JSON_INCOMPLETE_2.ToStream()) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(stream); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().Be(2); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().Be(2); traktSeasonWatchedProgress.Episodes.Should().NotBeNull().And.HaveCount(2); var episodesWatchedProgress = traktSeasonWatchedProgress.Episodes.ToArray(); episodesWatchedProgress[0].Should().NotBeNull(); episodesWatchedProgress[0].Number.Should().Be(1); episodesWatchedProgress[0].Completed.Should().BeTrue(); episodesWatchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); episodesWatchedProgress[1].Should().NotBeNull(); episodesWatchedProgress[1].Number.Should().Be(2); episodesWatchedProgress[1].Completed.Should().BeTrue(); episodesWatchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime()); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Null() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(default(Stream)); traktSeasonWatchedProgress.Should().BeNull(); }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Empty() { var jsonReader = new SeasonWatchedProgressObjectJsonReader(); var traktSeasonWatchedProgress = await jsonReader.ReadObjectAsync(string.Empty); traktSeasonWatchedProgress.Should().BeNull(); }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Empty() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var stream = string.Empty.ToStream()) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(stream); traktSeasonWatchedProgress.Should().BeNull(); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Empty() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var reader = new StringReader(string.Empty)) using (var jsonReader = new JsonTextReader(reader)) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(jsonReader); traktSeasonWatchedProgress.Should().BeNull(); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Not_Valid_5() { var jsonReader = new SeasonWatchedProgressObjectJsonReader(); var traktSeasonWatchedProgress = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_5); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().BeNull(); traktSeasonWatchedProgress.Episodes.Should().BeNull(); }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Incomplete_7() { var jsonReader = new SeasonWatchedProgressObjectJsonReader(); var traktSeasonWatchedProgress = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_7); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().Be(2); traktSeasonWatchedProgress.Episodes.Should().BeNull(); }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_5() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var stream = JSON_NOT_VALID_5.ToStream()) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(stream); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().BeNull(); traktSeasonWatchedProgress.Episodes.Should().BeNull(); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_7() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var stream = JSON_INCOMPLETE_7.ToStream()) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(stream); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().Be(2); traktSeasonWatchedProgress.Episodes.Should().BeNull(); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_5() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var reader = new StringReader(JSON_NOT_VALID_5)) using (var jsonReader = new JsonTextReader(reader)) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(jsonReader); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().BeNull(); traktSeasonWatchedProgress.Episodes.Should().BeNull(); } }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Incomplete_7() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); using (var reader = new StringReader(JSON_INCOMPLETE_7)) using (var jsonReader = new JsonTextReader(reader)) { var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(jsonReader); traktSeasonWatchedProgress.Should().NotBeNull(); traktSeasonWatchedProgress.Number.Should().BeNull(); traktSeasonWatchedProgress.Aired.Should().BeNull(); traktSeasonWatchedProgress.Completed.Should().Be(2); traktSeasonWatchedProgress.Episodes.Should().BeNull(); } }
public async Task Test_TraktSeasonWatchedProgress_From_Json() { var jsonReader = new SeasonWatchedProgressObjectJsonReader(); var seasonWatchedProgress = await jsonReader.ReadObjectAsync(JSON) as TraktSeasonWatchedProgress; seasonWatchedProgress.Should().NotBeNull(); seasonWatchedProgress.Number.Should().Be(2); seasonWatchedProgress.Aired.Should().Be(3); seasonWatchedProgress.Completed.Should().Be(2); seasonWatchedProgress.Episodes.Should().NotBeNull().And.HaveCount(2); var episodesWatchedProgress = seasonWatchedProgress.Episodes.ToArray(); episodesWatchedProgress[0].Should().NotBeNull(); episodesWatchedProgress[0].Number.Should().Be(1); episodesWatchedProgress[0].Completed.Should().BeTrue(); episodesWatchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); episodesWatchedProgress[1].Should().NotBeNull(); episodesWatchedProgress[1].Number.Should().Be(2); episodesWatchedProgress[1].Completed.Should().BeTrue(); episodesWatchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime()); }
public void Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Null() { var jsonReader = new SeasonWatchedProgressObjectJsonReader(); Func <Task <ITraktSeasonWatchedProgress> > traktSeasonWatchedProgress = () => jsonReader.ReadObjectAsync(default(string)); traktSeasonWatchedProgress.Should().Throw <ArgumentNullException>(); }
public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new SeasonWatchedProgressObjectJsonReader(); Func <Task <ITraktSeasonWatchedProgress> > traktSeasonWatchedProgress = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader)); await traktSeasonWatchedProgress.Should().ThrowAsync <ArgumentNullException>(); }