Ejemplo n.º 1
0
        public void WhenValidatingCommandWithUriThenReturnsTrue()
        {
            // Assign
            ICommandValidator      validator = new DefaultCommandValidator();
            CommandWithUriProperty command   = new CommandWithUriProperty();

            command.Property1 = new Uri("/test/values", UriKind.Relative);
            CommandHandlerRequest request = new CommandHandlerRequest(this.configuration, command);

            // Act
            bool result = validator.Validate(request);

            // Assert
            // A lots of properties of Uri throw exceptions but its still valid
            Assert.True(result);
            Assert.Equal(0, request.ModelState.Count);
        }
Ejemplo n.º 2
0
        public void WhenValidatingCommandWithUriThenReturnsTrue()
        {
            // Assign
            ICommandValidator validator = new DefaultCommandValidator();
            CommandWithUriProperty command = new CommandWithUriProperty();
            command.Property1 = new Uri("/test/values", UriKind.Relative);
            CommandHandlerRequest request = new CommandHandlerRequest(this.configuration, command);

            // Act
            bool result = validator.Validate(request);

            // Assert
            // A lots of properties of Uri throw exceptions but its still valid
            Assert.True(result);
            Assert.Equal(0, request.ModelState.Count);
        }