code refactor

This commit is contained in:
MaysWind
2024-04-04 20:42:40 +08:00
parent 46caf46ef7
commit 28f113d992
3 changed files with 27 additions and 7 deletions
+9
View File
@@ -216,6 +216,15 @@ func TestGetUnixTimeFromTransactionTime(t *testing.T) {
assert.Equal(t, expectedValue, actualValue)
}
func TestGetTransactionTimeRangeByYearMonth(t *testing.T) {
expectedMinValue := int64(1704016800000)
expectedMaxValue := int64(1706788799999)
actualMinValue, actualMaxValue, err := GetTransactionTimeRangeByYearMonth(2024, 1)
assert.Equal(t, nil, err)
assert.Equal(t, expectedMinValue, actualMinValue)
assert.Equal(t, expectedMaxValue, actualMaxValue)
}
func TestParseFromUnixTime(t *testing.T) {
expectedValue := int64(1617228083)
actualTime := parseFromUnixTime(expectedValue)