public void AddLinkCommand_Valid() { var command = new AddLinkCommand() { Name = "Google", Url = "http://www.google.com" }; var validator = new AddLinkCommandValidator(); var valid = validator.Validate(command); Assert.True(valid); }
public void AddLinkCommand_InValid() { var command = new AddLinkCommand() { Name = null, Url = "http://www.google.com" }; var validator = new AddLinkCommandValidator(); var valid = validator.Validate(command); Assert.False(valid); }
public void AddLinkCommand_Valid() { var addLinkCommand = new AddLinkCommand() { Name = "Google", Url = "http://www.google.com" }; var urlValidator = new UrlValidator(); var nameValidator = new NameValidator(maxLength: 100); nameValidator.Next(urlValidator); var validator = new AddLinkCommandValidator(nameValidator); var valid = validator.Validate(addLinkCommand); Assert.True(valid); }
public void AddLinkCommand_Invalid() { var addLinkCommand = new AddLinkCommand() { Name = "Google", Url = "invalid url" }; var urlValidator = new UrlValidator(); var nameValidator = new NameValidator(100); nameValidator.Next(urlValidator); var validator = new AddLinkCommandValidator(nameValidator); var valid = validator.Validate(addLinkCommand); Assert.False(valid); }