Ejemplo n.º 1
0
        private static void ReadCustomerFile(string[] args)
        {
            var filename = CSVFile.FindFile(args[0]);

            Console.WriteLine("Fetching bank consent for customers in {0}", filename);

            customers = new List <Customer>(CSVFile.ReadFile(filename));
        }
Ejemplo n.º 2
0
        public void FindFileTest()
        {
            var file = CSVFile.FindFile("testdata.csv");

            Assert.AreNotEqual(null, file);

            var info = new FileInfo(file);

            Assert.IsTrue(info.Exists);
        }
Ejemplo n.º 3
0
        public Service(string bankId, string URL = null)
        {
            this.bankId = bankId;

            var data = from c in CSVFile.ReadFile(CSVFile.FindFile("testdata.csv"))
                       where c.BankId == bankId
                       select new BankCustomer
            {
                Id       = c.CustomerId,
                Consent  = c.ConsentBank,
                PostCode = c.PostCode,
                City     = c.City
            };

            customers = new List <BankCustomer>(data);

            if (URL != null)
            {
                Uri baseAddress = new Uri(URL);
                host = new WebServiceHost(this, baseAddress);
                host.Open();
            }
        }
Ejemplo n.º 4
0
        public void LoadTestDataTest()
        {
            var data = new List <Customer>(CSVFile.ReadFile(CSVFile.FindFile("testdata.csv")));

            Assert.AreEqual(49, data.Count());
        }
Ejemplo n.º 5
0
        public void FindWrongFileTest()
        {
            var file = CSVFile.FindFile("wrongtestdata.csv");

            Assert.AreEqual(null, file);
        }