public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_1() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = JSON_INCOMPLETE_1.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Incomplete_2() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var reader = new StringReader(JSON_INCOMPLETE_2)) using (var jsonReader = new JsonTextReader(reader)) { var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(jsonReader); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_2() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = JSON_NOT_VALID_2.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Facebook.Should().BeTrue(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); } }
public void Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); Func <Task <ITraktMovieScrobblePostResponse> > movieScrobbleResponse = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader)); movieScrobbleResponse.Should().Throw <ArgumentNullException>(); }
public async Task Test_TraktMovieScrobblePostResponse_From_Json() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON) as TraktMovieScrobblePostResponse; movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Facebook.Should().BeTrue(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(default(JsonTextReader)); movieScrobbleResponse.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Empty() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(string.Empty); movieScrobbleResponse.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Null() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(default(Stream)); movieScrobbleResponse.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Empty() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = string.Empty.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Empty() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var reader = new StringReader(string.Empty)) using (var jsonReader = new JsonTextReader(reader)) { var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(jsonReader); movieScrobbleResponse.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Incomplete_8() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_8); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Not_Valid_6() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_6); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_7() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = JSON_INCOMPLETE_7.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Incomplete_8() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var reader = new StringReader(JSON_INCOMPLETE_8)) using (var jsonReader = new JsonTextReader(reader)) { var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(jsonReader); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_6() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var reader = new StringReader(JSON_NOT_VALID_6)) using (var jsonReader = new JsonTextReader(reader)) { var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(jsonReader); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Not_Valid_5() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_5); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Incomplete_9() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_9); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().BeNull(); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Incomplete_10() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); var movieScrobbleResponse = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_10); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().BeNull(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_5() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = JSON_INCOMPLETE_5.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(3373536623UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_JsonReader_Incomplete_9() { var traktJsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var reader = new StringReader(JSON_INCOMPLETE_9)) using (var jsonReader = new JsonTextReader(reader)) { var movieScrobbleResponse = await traktJsonReader.ReadObjectAsync(jsonReader); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().BeNull(); movieScrobbleResponse.Progress.Should().BeNull(); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Facebook.Should().BeTrue(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().BeNull(); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Json_String_Null() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); Func <Task <ITraktMovieScrobblePostResponse> > movieScrobbleResponse = () => jsonReader.ReadObjectAsync(default(string)); await movieScrobbleResponse.Should().ThrowAsync <ArgumentNullException>(); }