Increase test coverage

This commit is contained in:
Julian Kornberger 2016-11-20 19:18:59 +01:00
parent 0362bf1b03
commit 223e97bfaf
1 changed files with 15 additions and 0 deletions

View File

@ -47,3 +47,18 @@ func TestUnmarshalInvalidTime(t *testing.T) {
assert.EqualError(err, "invalid jsontime") assert.EqualError(err, "invalid jsontime")
assert.True(jsonTime.IsZero()) assert.True(jsonTime.IsZero())
} }
func TestGetTime(t *testing.T) {
assert := assert.New(t)
now := Now()
assert.Equal(now.GetTime(), now.time)
}
func TestAddAfterBefore(t *testing.T) {
assert := assert.New(t)
now := Now()
assert.True(now.Before(now.Add(time.Second)))
assert.True(now.After(now.Add(-time.Second)))
}