1package utils 2 3import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 8 ent "repodiff/entities" 9) 10 11func TestTimestampSeconds(t *testing.T) { 12 var oldTimestamp ent.RepoTimestamp = 1519322647 13 newTimestamp := TimestampSeconds() 14 assert.True(t, newTimestamp > oldTimestamp, "New timestamp should be greater than fixture") 15 16} 17 18func TestTimestampToDate(t *testing.T) { 19 var timestamp ent.RepoTimestamp = 1519322647 20 assert.Equal(t, "2018-02-22", TimestampToDate(timestamp), "Date conversion") 21} 22 23func TestTimestampToDataStudioDatetime(t *testing.T) { 24 var timestamp ent.RepoTimestamp = 1519322647 25 assert.Equal(t, "2018022210", TimestampToDataStudioDatetime(timestamp), "Datetime conversion") 26} 27