Example #1
0
func TestTimeToTimestamp(test *testing.T) {
	t := time.Unix(789697858, 137569000)
	expected := message.Timestamp(789697858137569)
	timestamp := message.TimeToTimestamp(t)

	if timestamp != expected {
		test.Error("Expected", expected, "but got", timestamp)
	}
}
Example #2
0
func TestTimestampToTime(test *testing.T) {
	timestamp := message.Timestamp(807656789876568412)
	expected := time.Unix(807656789876, 568412000)
	t := message.TimestampToTime(timestamp)

	if t != expected {
		test.Error("Expected", expected, "but got", t)
	}
}