You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_config_file return an Option<File> that is None if not found, and a file otherwise. (NOTE: Closing as not possible to test yet.)
get_config_file_to_write return an Result<File, StdIoError> that panics if permission is denied, and the result otherwise. (NOTE: Closing as not possible to test yet.)
read_config should return a Result<Config, ConfigError> and write_config a Result<(), ConfigError>.
cli/parse:
instantiate a CliArgs and then get_command_type with it to return a CommandType.
api:
api/client:
instantiate a TellerClient, Account and Transaction.
get_account returns an Account.
get_accounts returns a Vec<Account>.
get_transactions returns a Vec<Transaction>. Unable to test the timeframe thing easily, so ignore for now.
api/inform:
instantiate some Money.
get_account_balance should return some valid Money.
get_aggregates test that get_balances, get_incomings and get_outgoings return monthly absolute values with a currency from the current Account.
get_counterparties should return the grouped counterparties outgoing amounts for a particular timeframe.
get_incoming should return the Money of the sum of the positive transactions this month.
get_outgoing should return the Money of the absolute sum of the negative transactions this month.
get_transactions_with_currency should return a valid TransactionsWithCurrrency.
These tests will no longer be done as (1) testing exit codes is not that useful, and (2) perfect representation is not as important as actual computation (make more sense to see it with eyes, than to test spacing with code, etc.)
command for each test its represent_ and whether it can return 0 or 1 on network success/failure:
initialise.
list_accounts.
list_balances.
list_counterparties.
list_incomings.
list_outgoings.
list_transactions.
show_balance.
show_incoming.
show_outgoing.
show_usage.
The text was updated successfully, but these errors were encountered:
Write unit tests. Will potentially need yup-hyper-mock to help test the client, and to write Fs mocks for testing
config
.Before I can finish writing the tests I need to refactor a few hinderances to this in the code.
get_transactions
needs to a receive afrom_date
andto_date
which are computed within the commands from an injectedcurrent_time
.TellerClient
s in.inquirer/ask
:Question
?Answer
?ask_question
:Answer
. See test stdout and stdin and this.Option<Answer>
.ask_questions
:config
(see: http://doc.rust-lang.org/std/io/struct.Cursor.html#examples):get_config_path
returns the correct path.get_config_file
return anOption<File>
that isNone
if not found, and a file otherwise. (NOTE: Closing as not possible to test yet.)get_config_file_to_write
return anResult<File, StdIoError>
that panics if permission is denied, and the result otherwise. (NOTE: Closing as not possible to test yet.)read_config
should return aResult<Config, ConfigError>
andwrite_config
aResult<(), ConfigError>
.cli/parse
:CliArgs
and thenget_command_type
with it to return aCommandType
.api
:api/client
:TellerClient
,Account
andTransaction
.get_account
returns anAccount
.get_accounts
returns aVec<Account>
.get_transactions
returns aVec<Transaction>
. Unable to test the timeframe thing easily, so ignore for now.api/inform
:Money
.get_account_balance
should return some validMoney
.get_aggregates
test thatget_balances
,get_incomings
andget_outgoings
return monthly absolute values with a currency from the currentAccount
.get_counterparties
should return the grouped counterparties outgoing amounts for a particular timeframe.get_incoming
should return theMoney
of the sum of the positive transactions this month.get_outgoing
should return theMoney
of the absolute sum of the negative transactions this month.get_transactions_with_currency
should return a validTransactionsWithCurrrency
.These tests will no longer be done as (1) testing exit codes is not that useful, and (2) perfect representation is not as important as actual computation (make more sense to see it with eyes, than to test spacing with code, etc.)
command
for each test itsrepresent_
and whether it can return0
or1
on network success/failure:initialise
.list_accounts
.list_balances
.list_counterparties
.list_incomings
.list_outgoings
.list_transactions
.show_balance
.show_incoming
.show_outgoing
.show_usage
.The text was updated successfully, but these errors were encountered: