コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            ///<summary>
            ///Initialise the animal manager with a file containing a list of animals,
            ///and the listbox which they will be displayed in.
            ///</summary>
            animalManager = new AnimalManager("animalList.txt", showAnimalsLB);

            ///<summary>
            ///Initialise the array of PictureBoxes, and
            ///fill it with the listboxes on the form.
            ///</summary>
            pictureBoxes = new PictureBox[4];
            pictureBoxes[0] = animal1PB;
            pictureBoxes[1] = animal2PB;
            pictureBoxes[2] = animal3PB;
            pictureBoxes[3] = animal4PB;

            ///<summary>
            ///Load the animals from the file
            ///</summary>
            animalManager.loadCritterList();

            ///<summary>
            ///Retrieve the list of animals which were
            ///loaded with the previous method call.
            ///</summary>
            animals = animalManager.getAnimalsList();
        }
コード例 #2
0
 public void loadCritterListTest1()
 {
     string animalsListFile = string.Empty; // TODO: Initialize to an appropriate value
     ListBox animalListBox = null; // TODO: Initialize to an appropriate value
     AnimalManager target = new AnimalManager(animalsListFile, animalListBox); // TODO: Initialize to an appropriate value
     target.loadCritterList();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }