public void UserInsertCommand_invalid_login_invalid(string param) { UserInsertCommand _command = new UserInsertCommand(); _command.Email = "*****@*****.**"; _command.Login = param; _command.Name = "carlos"; _command.Password = "******"; _command.Role = "role"; _command.Validate(); var _notification = (List <Flunt.Notifications.Notification>)_command.Notifications; Assert.False(_command.Valid); Assert.True(_command.Invalid); Assert.NotEmpty(_command.Email); if (param == null) { Assert.Null(_command.Login); } else { Assert.Empty(_command.Login); } Assert.NotEmpty(_command.Name); Assert.NotEmpty(_command.Password); Assert.NotEmpty(_command.Role); Assert.True(((List <Flunt.Notifications.Notification>)_command.Notifications).Count == 1); Assert.Equal("Login not be null.", _notification[0].Message); }
public void UserInsertCommand_valid() { UserInsertCommand _command = new UserInsertCommand(); _command.Email = "*****@*****.**"; _command.Login = "******"; _command.Name = "carlos"; _command.Password = "******"; _command.Role = "role"; _command.Validate(); var _notification = (List <Flunt.Notifications.Notification>)_command.Notifications; Assert.True(_command.Valid); Assert.False(_command.Invalid); Assert.NotEmpty(_command.Email); Assert.NotEmpty(_command.Login); Assert.NotEmpty(_command.Name); Assert.NotEmpty(_command.Password); Assert.NotEmpty(_command.Role); Assert.True(((List <Flunt.Notifications.Notification>)_command.Notifications).Count == 0); }