pub struct MockBalanceTracker { /* private fields */ }Expand description
Mock balance tracker for testing.
Implementations§
Source§impl MockBalanceTracker
impl MockBalanceTracker
pub fn new() -> Self
Sourcepub fn get_balance(&self, account: &str) -> Decimal
pub fn get_balance(&self, account: &str) -> Decimal
Get balance for an account.
Sourcepub fn update_balance(&self, account: &str, amount: Decimal)
pub fn update_balance(&self, account: &str, amount: Decimal)
Update balance for an account.
Sourcepub fn apply_entry(&self, entry: &JournalEntry)
pub fn apply_entry(&self, entry: &JournalEntry)
Apply a journal entry to the balances.
Sourcepub fn total_debits(&self) -> Decimal
pub fn total_debits(&self) -> Decimal
Get total debits across all accounts.
Sourcepub fn total_credits(&self) -> Decimal
pub fn total_credits(&self) -> Decimal
Get total credits across all accounts (as positive number).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockBalanceTracker
impl RefUnwindSafe for MockBalanceTracker
impl Send for MockBalanceTracker
impl Sync for MockBalanceTracker
impl Unpin for MockBalanceTracker
impl UnwindSafe for MockBalanceTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more