mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add some unit tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
34
model/license_test.go
Normal file
34
model/license_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLicenseExpired(t *testing.T) {
|
||||
l1 := License{}
|
||||
l1.ExpiresAt = GetMillis() - 1000
|
||||
if !l1.IsExpired() {
|
||||
t.Fatal("license should be expired")
|
||||
}
|
||||
|
||||
l1.ExpiresAt = GetMillis() + 10000
|
||||
if l1.IsExpired() {
|
||||
t.Fatal("license should not be expired")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLicenseStarted(t *testing.T) {
|
||||
l1 := License{}
|
||||
l1.StartsAt = GetMillis() - 1000
|
||||
if !l1.IsStarted() {
|
||||
t.Fatal("license should be started")
|
||||
}
|
||||
|
||||
l1.StartsAt = GetMillis() + 10000
|
||||
if l1.IsStarted() {
|
||||
t.Fatal("license should not be started")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user