public void Test_UserListCommentsRequest_Validate_Throws_Exceptions()
        {
            // username is null
            var requestMock = new UserListCommentsRequest {
                Id = "123"
            };

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

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

            // empty username
            requestMock = new UserListCommentsRequest {
                Username = string.Empty, Id = "123"
            };

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

            // username with spaces
            requestMock = new UserListCommentsRequest {
                Username = "******", Id = "123"
            };

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

            // id is null
            requestMock = new UserListCommentsRequest {
                Username = "******"
            };

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

            // empty id
            requestMock = new UserListCommentsRequest {
                Username = "******", Id = string.Empty
            };

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

            // id with spaces
            requestMock = new UserListCommentsRequest {
                Username = "******", Id = "invalid id"
            };

            act = () => requestMock.Validate();
            act.Should().Throw <ArgumentException>();
        }
        public void Test_UserListCommentsRequest_Has_Valid_UriTemplate()
        {
            var request = new UserListCommentsRequest();

            request.UriTemplate.Should().Be("users/{username}/lists/{id}/comments{/sort_order}{?page,limit}");
        }
        public void Test_UserListCommentsRequest_Has_AuthorizationRequirement_Not_Required()
        {
            var request = new UserListCommentsRequest();

            request.AuthorizationRequirement.Should().Be(AuthorizationRequirement.NotRequired);
        }
        public void Test_UserListCommentsRequest_Returns_Valid_RequestObjectType()
        {
            var requestMock = new UserListCommentsRequest();

            requestMock.RequestObjectType.Should().Be(RequestObjectType.Lists);
        }
Esempio n. 5
0
        public void Test_UserListCommentsRequest_Has_AuthorizationRequirement_Optional()
        {
            var request = new UserListCommentsRequest();

            request.AuthorizationRequirement.Should().Be(AuthorizationRequirement.Optional);
        }