Exemple #1
0
        public void GetTextBox()
        {
            Gauls gauls = new Gauls();
            Assert.AreEqual("t1", gauls.GetTextBoxName("Phalanx"));
            Assert.AreEqual("t6", gauls.GetTextBoxName("Haeduan"));
            Assert.AreEqual("t9", gauls.GetTextBoxName("unit u29"));
            Assert.AreEqual("t10", gauls.GetTextBoxName("Settler"));
            Console.WriteLine(gauls.UnitList());

            Romans romans = new Romans();
            Assert.AreEqual("t1", romans.GetTextBoxName("Phalanx"));
            Assert.AreEqual("t6", romans.GetTextBoxName("EquitesCaesaris"));
            Console.WriteLine(romans.UnitList());

            Teutons teutons = new Teutons();
            Assert.AreEqual("t1", teutons.GetTextBoxName("EquitesCaesaris"));
            Assert.AreEqual("t4", teutons.GetTextBoxName("Scout"));
            Console.WriteLine(teutons.UnitList());
        }
Exemple #2
0
        private static string GetUnitTextBox(Tribes tribes,
            string troopName)
        {
            string textBoxName = "t1";
            switch (tribes)
            {
                case Tribes.Gauls:
                {
                    Gauls units = new Gauls();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                case Tribes.Romans:
                {
                    Romans units = new Romans();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                case Tribes.Teutons:
                {
                    Romans units = new Romans();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                default:
                {
                    break;
                }
            }
            return textBoxName;
        }