Exemplo n.º 1
0
        static void Main(string[] args)
        {
            League AFC = new League();
            FileWrite fw = new FileWrite();
            FileRead fr = new FileRead();

            AFC.TradePlayer(AFC._teams[0], AFC._teams[1], AFC._teams[0]._roster.Players[3]);

            fw.WriteToFile("../../Team1Roster.txt", AFC._teams[0]._roster.ToString());
            fw.WriteToFile("../../Team2Roster.txt", AFC._teams[1]._roster.ToString());

            Console.WriteLine("Top 5 Players for the " + AFC._teams[0]._name);
               foreach(string msg in AFC._teams[0])
            {
                Console.WriteLine(msg);
            }

            Console.ReadKey();
            Console.WriteLine(fr.readFile("../../Team1Roster.txt"));
            Console.WriteLine(fr.readFile("../../Team2Roster.txt"));
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public void TradePlayerTest()
        {
            League league = new League();
            Quarterback expected;
            Team Team1;
            Team Team2;

            Quarterback TestQB;

            expected = new Quarterback("Bilbo Baggins", 110, 95, 10, 75, 8, 55);
            TestQB = new Quarterback("Bilbo Baggins", 110, 95, 10, 75, 8, 55);
            Team1 = new Team("The Shire");
            Team2 = new Team("Mordor");

            Team1._roster.Players.Add(TestQB);

            league.TradePlayer(Team1, Team2, Team1._roster.Players[9]);

            Assert.AreEqual(expected._name, Team2._roster.Players[9]._name);
            Assert.AreEqual(expected._age, Team2._roster.Players[9]._age);
            Assert.AreEqual(expected._position, Team2._roster.Players[9]._position);
            Assert.AreEqual(expected._rating, Team2._roster.Players[9]._rating);
            Assert.AreEqual(expected._weight, Team2._roster.Players[9]._weight);
        }