mirror of
https://github.com/wahyd4/loginsrv.git
synced 2026-08-09 04:46:29 +10:00
added test for claim valid method
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
. "github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Test_UserInfo_Valid(t *testing.T) {
|
||||
Error(t, UserInfo{Expiry: 0}.Valid())
|
||||
Error(t, UserInfo{Expiry: time.Now().Add(-1 * time.Second).Unix()}.Valid())
|
||||
NoError(t, UserInfo{Expiry: time.Now().Add(time.Second).Unix()}.Valid())
|
||||
}
|
||||
Reference in New Issue
Block a user