コード例 #1
0
        public async Task InvalidCommand_Exception(int nameLength, int descriptionLength)
        {
            if (nameLength < 0 || descriptionLength < 0)
            {
                return;
            }
            var name        = new string('x', nameLength);
            var description = new string('x', descriptionLength);
            var validator   = new UpdateLocationCommandValidator();
            var command     = new UpdateLocationCommand {
                Name = name, Description = description
            };

            var result = await validator.ValidateAsync(command);

            Assert.NotNull(result);
            Assert.False(result.IsValid);
        }
 public UpdateLocationCommandValidatorTests()
 {
     this.updateValidator = new UpdateLocationCommandValidator();
     this.updateCommand   = new UpdateLocationCommand();
 }