1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01: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

19
model/theme_test.go Normal file
View file

@ -0,0 +1,19 @@
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package model
import "testing"
func TestValidateTheme(t *testing.T) {
for _, status := range []string{"default", "black"} {
if err := ValidateTheme(status); err != nil {
t.Error(`A valid theme should not generate any error`)
}
}
if err := ValidateTheme("invalid"); err == nil {
t.Error(`An invalid theme should generate a error`)
}
}