Пример #1
0
        public void Test_ASeasonRequest_1_Validate_Throws_Exceptions()
        {
            // id is null
            var requestMock = new SeasonRequestMock();

            Action act = () => requestMock.Validate();

            act.Should().Throw <ArgumentNullException>();

            // empty id
            requestMock = new SeasonRequestMock {
                Id = string.Empty
            };

            act = () => requestMock.Validate();
            act.Should().Throw <ArgumentException>();

            // id with spaces
            requestMock = new SeasonRequestMock {
                Id = "invalid id"
            };

            act = () => requestMock.Validate();
            act.Should().Throw <ArgumentException>();
        }
Пример #2
0
        public void Test_ASeasonRequest_1_Returns_Valid_UriPathParameters()
        {
            // with implicit season number
            var requestMock = new SeasonRequestMock {
                Id = "123"
            };

            requestMock.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(2)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"]     = "123",
                ["season"] = "0"
            });

            // with explicit season number
            requestMock = new SeasonRequestMock {
                Id = "123", SeasonNumber = 2
            };

            requestMock.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(2)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"]     = "123",
                ["season"] = "2"
            });
        }
Пример #3
0
        public void Test_ASeasonRequest_1_Returns_Valid_RequestObjectType()
        {
            var requestMock = new SeasonRequestMock();

            requestMock.RequestObjectType.Should().Be(RequestObjectType.Seasons);
        }
Пример #4
0
        public void Test_ASeasonRequest_1_Has_AuthorizationRequirement_NotRequired()
        {
            var requestMock = new SeasonRequestMock();

            requestMock.AuthorizationRequirement.Should().Be(AuthorizationRequirement.NotRequired);
        }