Exemplo n.º 1
0
        public void Test_AMovieRequest_1_Validate_Throws_Exceptions()
        {
            // id is null
            var requestMock = new MovieRequestMock();

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

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

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

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

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

            act = () => requestMock.Validate();
            act.Should().Throw <ArgumentException>();
        }
Exemplo n.º 2
0
        public void Test_AMovieRequest_1_Returns_Valid_UriPathParameters()
        {
            var requestMock = new MovieRequestMock {
                Id = "123"
            };

            requestMock.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(1)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"] = "123"
            });
        }
Exemplo n.º 3
0
        public void Test_AMovieRequest_1_Returns_Valid_RequestObjectType()
        {
            var requestMock = new MovieRequestMock();

            requestMock.RequestObjectType.Should().Be(RequestObjectType.Movies);
        }
Exemplo n.º 4
0
        public void Test_AMovieRequest_1_Has_AuthorizationRequirement_NotRequired()
        {
            var requestMock = new MovieRequestMock();

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