static void Main(string[] args) { var transactionsParser = new TransactionsParser(); var res = transactionsParser.ParseTransactions(new string[] { }); var accountStorage = new AccountStorage(); var transactionsImporter = new TransactionsImporter(accountStorage, transactionsParser); var accountGuid = Guid.Parse("a7fce19b-ab94-4e4f-891c-6003dce94aa0"); var account = new Account(accountGuid); accountStorage.Save(account); while (Console.ReadLine() != "exit") { Console.WriteLine("Importing transactions..."); transactionsImporter.ImportTransactions("transactions.txt", account.Id); var updatedAccount = accountStorage.Get(accountGuid); Console.WriteLine($"Account contains {updatedAccount.Transactions.Count} transactions"); } }
/// <summary> /// 全アカウントを保存する。 /// </summary> /// <exception cref="AccountStorageException">保存に失敗した場合</exception> public void SaveAccounts() { _accountStorage.Save(_accountList); ClearHasUnsavedChanges(); }