1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add unit tests for models

This commit is contained in:
Frédéric Guillot 2017-11-25 19:06:02 -08:00
parent 4560af165e
commit 51f7775466
7 changed files with 224 additions and 1 deletions

View file

@ -42,6 +42,10 @@ func (u User) ValidateUserCreation() error {
// ValidateUserModification validates user for modification.
func (u User) ValidateUserModification() error {
if u.ID <= 0 {
return errors.New("The ID is mandatory")
}
if u.Username == "" {
return errors.New("The username is mandatory")
}