Example #1
0
        public void CanListAccount(string accountNumber, string name, decimal balance, AccountType type)
        {
            List <string> accountList = new List <string>();

            accountList.Add($"{accountNumber},{name},{balance},{type.ToString().Substring(0, 1).ToUpper()}");
            FileAccountRepository file = new FileAccountRepository();

            file.SaveToFile(accountList, @"C:\Test\FileTest.txt");

            Account accountToCheck = new Account()
            {
                AccountNumber = "00000", Name = name, Balance = balance, Type = type
            };
            List <string> accountExtract = file.ListAccount(accountToCheck, @"C:\Test\FileTest.txt");

            Assert.AreEqual(accountList[0], accountExtract[0]);
        }