chore: add tests for all utils, removed unused functions

This commit is contained in:
Deluan
2020-03-24 11:58:58 -04:00
parent b4c7cac964
commit 3cba5f70fd
7 changed files with 275 additions and 188 deletions
+8 -9
View File
@@ -1,17 +1,16 @@
package utils
import (
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestTimeConversion(t *testing.T) {
Convey("Conversion should work both ways", t, func() {
now := time.Date(2002, 8, 9, 12, 11, 13, 1000000, time.Local)
milli := ToMillis(now)
So(ToTime(milli).String(), ShouldEqual, now.String())
var _ = Describe("Time Conversion", func() {
It("converts from Date to Millis and back to Date", func() {
date := time.Date(2002, 8, 9, 12, 11, 13, 1000000, time.Local)
milli := ToMillis(date)
Expect(ToTime(milli)).To(Equal(date))
})
}
})