Example #1
0
        public void readFileTest()
        {
            FileReader fr = new FileReader();

            ArrayList arrayList = fr.readFile();
            Assert.IsNotNull(arrayList);
        }
        public void readData()
        {
            FileReader fr = new FileReader();
            ArrayList animals = fr.readFile();
            ArrayList birds = new ArrayList();
            ArrayList fish = new ArrayList();

            foreach (Animal a in animals)
            {
                if (a.GetType() == typeof(Bird))
                {
                    birds.Add((Bird)a);
                }
                else if (a.GetType() == typeof(Fish))
                {
                    fish.Add((Fish)a);
                }
            }

            if (birds.Count > 0)
            {
                dbConnector.insertBirds(birds);
            }
            if (fish.Count > 0)
            {
                dbConnector.insertFish(fish);
            }
        }
 private PersistenceController()
 {
     reader = new FileReader();
 }
 public ArrayList getStock()
 {
     FileReader file = new FileReader();
     return file.animals;
 }