mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
code refactor
This commit is contained in:
@@ -8,34 +8,34 @@ import (
|
||||
|
||||
func TestBeancountAccount_IsOpeningBalanceEquityAccount_True(t *testing.T) {
|
||||
account := beancountAccount{
|
||||
accountType: beancountEquityAccountType,
|
||||
name: "Equity:Opening-Balances",
|
||||
AccountType: beancountEquityAccountType,
|
||||
Name: "Equity:Opening-Balances",
|
||||
}
|
||||
assert.True(t, account.isOpeningBalanceEquityAccount())
|
||||
|
||||
account = beancountAccount{
|
||||
accountType: beancountEquityAccountType,
|
||||
name: "E:Opening-Balances",
|
||||
AccountType: beancountEquityAccountType,
|
||||
Name: "E:Opening-Balances",
|
||||
}
|
||||
assert.True(t, account.isOpeningBalanceEquityAccount())
|
||||
}
|
||||
|
||||
func TestBeancountAccount_IsOpeningBalanceEquityAccount_False(t *testing.T) {
|
||||
account := beancountAccount{
|
||||
accountType: beancountAssetsAccountType,
|
||||
name: "Equity:Opening-Balances",
|
||||
AccountType: beancountAssetsAccountType,
|
||||
Name: "Equity:Opening-Balances",
|
||||
}
|
||||
assert.False(t, account.isOpeningBalanceEquityAccount())
|
||||
|
||||
account = beancountAccount{
|
||||
accountType: beancountEquityAccountType,
|
||||
name: "Opening-Balances",
|
||||
AccountType: beancountEquityAccountType,
|
||||
Name: "Opening-Balances",
|
||||
}
|
||||
assert.False(t, account.isOpeningBalanceEquityAccount())
|
||||
|
||||
account = beancountAccount{
|
||||
accountType: beancountEquityAccountType,
|
||||
name: "Equity:Other",
|
||||
AccountType: beancountEquityAccountType,
|
||||
Name: "Equity:Other",
|
||||
}
|
||||
assert.False(t, account.isOpeningBalanceEquityAccount())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user