コード例 #1
0
        public void LoadWithGoodPathTest()
        {
            BotsLoader loader = new BotsLoader();

            Assert.AreEqual(3, loader.Load("../../../../Plugins/Dlls/Bots.dll"));
            Assert.AreEqual(3, loader.SuccessfullyLoadedBots);
            Assert.AreEqual(3, loader.NumberOfBots);
        }
コード例 #2
0
        public void LoadWithBadPathTest()
        {
            BotsLoader loader = new BotsLoader();

            Assert.AreEqual(0, loader.Load("../../../../Plugins"));
            Assert.AreEqual(0, loader.SuccessfullyLoadedBots);
            Assert.AreEqual(0, loader.NumberOfBots);
        }
コード例 #3
0
        public void TakeBotsBadlyTest()
        {
            BotsLoader loader = new BotsLoader();

            loader.Load("../../../../Plugins");
            (List <IPlayer>, List <string>)bots = loader.TakeBots();

            Assert.AreEqual(0, bots.Item1.Count);
            Assert.AreEqual(0, bots.Item2.Count);
            Assert.IsFalse(bots.Item2.Contains("HalvesBot"));
            Assert.IsFalse(bots.Item2.Contains("PlusMinusBot"));
            Assert.IsFalse(bots.Item2.Contains("StandartBot"));
        }
コード例 #4
0
        public void TakeBotsWellTest()
        {
            BotsLoader loader = new BotsLoader();

            loader.Load("../../../../Plugins/Dlls/Bots.dll");
            (List <IPlayer>, List <string>)bots = loader.TakeBots();

            Assert.AreEqual(3, bots.Item1.Count);
            Assert.AreEqual(3, bots.Item2.Count);
            Assert.IsTrue(bots.Item2.Contains("HalvesBot"));
            Assert.IsTrue(bots.Item2.Contains("PlusMinusBot"));
            Assert.IsTrue(bots.Item2.Contains("StandartBot"));
        }
コード例 #5
0
        private static void PlayWithPlugins(string?path)
        {
            BotsLoader   loader = new BotsLoader();
            CasinoLaunch casino;

            (List <IPlayer>, List <string>)bots;

            int length = loader.Load(path);

            bots = loader.TakeBots();

            for (int i = 0; i < length; i++)
            {
                casino = new CasinoLaunch(bots.Item1[i], bots.Item2[i]);
                casino.StartCasino();
                casino.PrintInfo();
            }
        }