mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
support setting the last 1 to 3 days of the month to scheduled transaction frequency
This commit is contained in:
@@ -333,6 +333,32 @@ func TestIsUnixTimeEqualsYearAndMonth(t *testing.T) {
|
||||
assert.Equal(t, false, actualValue)
|
||||
}
|
||||
|
||||
func TestGetMaxDayOfMonth(t *testing.T) {
|
||||
expectedValue := 31
|
||||
actualValue := GetMaxDayOfMonth(2023, 1)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
|
||||
expectedValue = 28
|
||||
actualValue = GetMaxDayOfMonth(2023, 2)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
|
||||
expectedValue = 29
|
||||
actualValue = GetMaxDayOfMonth(2024, 2)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
|
||||
expectedValue = 30
|
||||
actualValue = GetMaxDayOfMonth(2023, 4)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
|
||||
expectedValue = 31
|
||||
actualValue = GetMaxDayOfMonth(2023, 12)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
|
||||
expectedValue = 28
|
||||
actualValue = GetMaxDayOfMonth(2100, 2)
|
||||
assert.Equal(t, expectedValue, actualValue)
|
||||
}
|
||||
|
||||
func TestGetTimezoneOffsetMinutes_FixedTimezone(t *testing.T) {
|
||||
timezone := time.FixedZone("Test Timezone", 120*60)
|
||||
expectedValue := int16(120)
|
||||
|
||||
Reference in New Issue
Block a user