Ejemplo n.º 1
0
        public void Test_UserCommentsRequest_Validate_Throws_Exceptions()
        {
            // username is null
            var requestMock = new UserCommentsRequest();

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

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

            // empty username
            requestMock = new UserCommentsRequest {
                Username = string.Empty
            };

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

            // username with spaces
            requestMock = new UserCommentsRequest {
                Username = "******"
            };

            act = () => requestMock.Validate();
            act.Should().Throw <ArgumentException>();
        }
Ejemplo n.º 2
0
        public void Test_UserCommentsRequest_Has_Valid_UriTemplate()
        {
            var request = new UserCommentsRequest();

            request.UriTemplate.Should().Be("users/{username}/comments{/comment_type}{/object_type}{?include_replies,extended,page,limit}");
        }
Ejemplo n.º 3
0
        public void Test_UserCommentsRequest_Has_AuthorizationRequirement_Optional()
        {
            var request = new UserCommentsRequest();

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