From 51f77754660ddcd29f61be293a8e405d8cd3ba18 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 25 Nov 2017 19:06:02 -0800 Subject: Add unit tests for models --- model/theme_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 model/theme_test.go (limited to 'model/theme_test.go') diff --git a/model/theme_test.go b/model/theme_test.go new file mode 100644 index 0000000..b2a8cdb --- /dev/null +++ b/model/theme_test.go @@ -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`) + } +} -- cgit v1.2.3