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:
parent
4560af165e
commit
51f7775466
7 changed files with 224 additions and 1 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue