<commit_before>﻿namespace TraktApiSharp.Tests.Objects.Post.Scrobbles.Responses
{
    using FluentAssertions;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Newtonsoft.Json;
    using TraktApiSharp.Enums;
    using TraktApiSharp.Objects.Post.Scrobbles.Responses;
    using Utils;

    [TestClass]
    public class TraktMovieScrobblePostResponseTests
    {
        [TestMethod]
        public void TestTraktMovieScrobblePostResponseDefaultConstructor()
        {
            var movieScrobbleResponse = new TraktMovieScrobblePostResponse();

            movieScrobbleResponse.Action.Should().BeNull();
            movieScrobbleResponse.Progress.Should().NotHaveValue();
            movieScrobbleResponse.Sharing.Should().BeNull();
            movieScrobbleResponse.Movie.Should().BeNull();
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponseStartReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MovieStartScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Start);
            movieScrobbleResponse.Progress.Should().Be(1.25f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeTrue();
            movieScrobbleResponse.Sharing.Twitter.Should().BeTrue();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponsePauseReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MoviePauseScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Pause);
            movieScrobbleResponse.Progress.Should().Be(75.0f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeFalse();
            movieScrobbleResponse.Sharing.Twitter.Should().BeFalse();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponseStopReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MovieStopScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop);
            movieScrobbleResponse.Progress.Should().Be(85.0f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeFalse();
            movieScrobbleResponse.Sharing.Twitter.Should().BeFalse();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }
    }
}<commit_msg>Update tests for TraktMovieScrobblePostResponse<commit_after>﻿namespace TraktApiSharp.Tests.Objects.Post.Scrobbles.Responses
{
    using FluentAssertions;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Newtonsoft.Json;
    using TraktApiSharp.Enums;
    using TraktApiSharp.Objects.Post.Scrobbles.Responses;
    using Utils;

    [TestClass]
    public class TraktMovieScrobblePostResponseTests
    {
        [TestMethod]
        public void TestTraktMovieScrobblePostResponseDefaultConstructor()
        {
            var movieScrobbleResponse = new TraktMovieScrobblePostResponse();

            movieScrobbleResponse.Id.Should().Be(0);
            movieScrobbleResponse.Action.Should().BeNull();
            movieScrobbleResponse.Progress.Should().NotHaveValue();
            movieScrobbleResponse.Sharing.Should().BeNull();
            movieScrobbleResponse.Movie.Should().BeNull();
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponseStartReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MovieStartScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Id.Should().Be(0);
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Start);
            movieScrobbleResponse.Progress.Should().Be(1.25f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeTrue();
            movieScrobbleResponse.Sharing.Twitter.Should().BeTrue();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponsePauseReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MoviePauseScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Id.Should().Be(0);
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Pause);
            movieScrobbleResponse.Progress.Should().Be(75.0f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeFalse();
            movieScrobbleResponse.Sharing.Twitter.Should().BeFalse();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }

        [TestMethod]
        public void TestTraktMovieScrobblePostResponseStopReadFromJson()
        {
            var jsonFile = TestUtility.ReadFileContents(@"Objects\Post\Scrobbles\Responses\MovieStopScrobblePostResponse.json");

            jsonFile.Should().NotBeNullOrEmpty();

            var movieScrobbleResponse = JsonConvert.DeserializeObject<TraktMovieScrobblePostResponse>(jsonFile);

            movieScrobbleResponse.Should().NotBeNull();
            movieScrobbleResponse.Id.Should().Be(3373536622);
            movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop);
            movieScrobbleResponse.Progress.Should().Be(85.0f);
            movieScrobbleResponse.Sharing.Should().NotBeNull();
            movieScrobbleResponse.Sharing.Facebook.Should().BeFalse();
            movieScrobbleResponse.Sharing.Twitter.Should().BeFalse();
            movieScrobbleResponse.Sharing.Tumblr.Should().BeFalse();
            movieScrobbleResponse.Movie.Should().NotBeNull();
            movieScrobbleResponse.Movie.Title.Should().Be("Guardians of the Galaxy");
            movieScrobbleResponse.Movie.Year.Should().Be(2014);
            movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
            movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(28U);
            movieScrobbleResponse.Movie.Ids.Slug.Should().Be("guardians-of-the-galaxy-2014");
            movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2015381");
            movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(118340U);
        }
    }
}
{'fraction_non_alphanumeric': 0.11547386985983477, 'fraction_numerical': 0.015687366564559546, 'mean_word_length': 3.1311349693251533, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4829326', 'n_tokens_mistral': 3263, 'n_tokens_neox': 3030, 'n_words': 241}