示例#1
0
        public void TestTraktCalendarUserMoviesRequestUriParamsWithoutStartDateAndDays()
        {
            var request   = new TraktCalendarUserMoviesRequest(null);
            var uriParams = request.GetUriPathParameters();

            uriParams.Should().NotBeNull().And.BeEmpty();
        }
示例#2
0
        public void TestTraktCalendarUserMoviesRequestUriParamsWithStartDate()
        {
            var startDate = DateTime.Now;

            var request = new TraktCalendarUserMoviesRequest(null)
            {
                StartDate = startDate
            };

            var uriParams = request.GetUriPathParameters();

            uriParams.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(1);
            uriParams.Should().Contain("start_date", startDate.ToTraktDateString());
        }
示例#3
0
        public void TestTraktCalendarUserMoviesRequestUriParamsWithDays()
        {
            var startDate = DateTime.Now;
            var days      = 14;

            var request = new TraktCalendarUserMoviesRequest(null)
            {
                Days = days
            };

            var uriParams = request.GetUriPathParameters();

            uriParams.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

            uriParams.Should().Contain(new Dictionary <string, object>
            {
                ["start_date"] = startDate.ToTraktDateString(),
                ["days"]       = days
            });
        }
示例#4
0
        public void TestTraktCalendarUserMoviesRequestHasValidUriTemplate()
        {
            var request = new TraktCalendarUserMoviesRequest(null);

            request.UriTemplate.Should().Be("calendars/my/movies{/start_date}{/days}{?extended,query,years,genres,languages,countries,runtimes,ratings}");
        }
示例#5
0
        public void TestTraktCalendarUserMoviesRequestHasAuthorizationRequired()
        {
            var request = new TraktCalendarUserMoviesRequest(null);

            request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.Required);
        }