public async Task Test_TraktCommentsModule_PostMovieComment_ArgumentExceptions() { ITraktMovie movie = new TraktMovie { Title = "Guardians of the Galaxy", Year = 2014, Ids = new TraktMovieIds { Trakt = 28, Slug = "guardians-of-the-galaxy-2014", Imdb = "tt2015381", Tmdb = 118340 } }; ITraktMovieCommentPost movieCommentPost = new TraktMovieCommentPost { Movie = movie, Comment = COMMENT_TEXT }; string postJson = await TestUtility.SerializeObject(movieCommentPost); postJson.Should().NotBeNullOrEmpty(); TraktClient client = TestUtility.GetOAuthMockClient(POST_MOVIE_COMMENT_URI, postJson, COMMENT_POST_RESPONSE_JSON); Func <Task <TraktResponse <ITraktCommentPostResponse> > > act = () => client.Comments.PostMovieCommentAsync(null, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentNullException>(); movie.Title = string.Empty; act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentException>(); movie.Title = "Guardians of the Galaxy"; movie.Year = 0; act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentOutOfRangeException>(); movie.Year = 123; act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentOutOfRangeException>(); movie.Year = 12345; act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentOutOfRangeException>(); movie.Year = 2014; movie.Ids = null; act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentNullException>(); movie.Ids = new TraktMovieIds(); act = () => client.Comments.PostMovieCommentAsync(movie, COMMENT_TEXT); await act.Should().ThrowAsync <ArgumentException>(); movie.Ids = new TraktMovieIds { Trakt = 28, Slug = "guardians-of-the-galaxy-2014", Imdb = "tt2015381", Tmdb = 118340 }; act = () => client.Comments.PostMovieCommentAsync(movie, null); await act.Should().ThrowAsync <ArgumentException>(); act = () => client.Comments.PostMovieCommentAsync(movie, string.Empty); await act.Should().ThrowAsync <ArgumentException>(); const string comment = "one two three four"; act = () => client.Comments.PostMovieCommentAsync(movie, comment); await act.Should().ThrowAsync <ArgumentOutOfRangeException>(); }