public void WritesCorrectNumberOfLines()
        {
            var bank   = new MockBank();
            var output = new List <string>();
            var writer = new MockWriter(output);

            CreateFileData.CreateFile(bank, writer);

            Assert.Equal(output.Count, 9);
        }
        public void WritesCorrectFormat()
        {
            var bank   = new MockBank();
            var output = new List <string>();
            var writer = new MockWriter(output);

            CreateFileData.CreateFile(bank, writer);

            Assert.Equal(output[0], "3");
            Assert.Equal(output[1], "1001;559268 - 7528;Berglunds snabbköp;Berguvsvägen  8;Luleå;;S - 958 22;Sweden;0921 - 12 34 65");
            Assert.Equal(output[4], "4");
            Assert.Equal(output[5], "13001;1001;100");
        }
Ejemplo n.º 3
0
        private static void CreateFileAndDisplayStatistics(Bank bank)
        {
            var fileName = DateTime.Now.ToString("yyyyMMdd-HHmm") + ".txt";
            var path     = CreateFileData.GetPath(fileName);

            var writer = new Writer(path, true);

            CreateFileData.CreateFile(bank, writer);

            Console.WriteLine("Sparar till " + fileName + "...");
            Console.WriteLine("Antal kunder: " + bank.Customers.Count);
            Console.WriteLine("Antal konton: " + bank.Accounts.Count);
            Console.WriteLine("Totalt saldo: " + bank.TotalBalance);
        }