Example #1
0
        public void TestConstructor()
        {
            var manaPool = new ManaPool ();

            foreach (var color in EnumUtil.GetValues<COLOR>()) {
                Assert.AreEqual (0, manaPool [color]);
            }
        }
Example #2
0
        public void TestClear()
        {
            var manaPool = new ManaPool ();

            manaPool.Add (COLOR.Red, 2);
            manaPool.Add (COLOR.Green, 2);
            manaPool.Add (COLOR.Blue, 3);

            manaPool.Clear ();
            foreach (var color in EnumUtil.GetValues<COLOR>()) {
                Assert.AreEqual (0, manaPool [color]);
            }
        }
Example #3
0
        public void TestRemove()
        {
            var manaPool = new ManaPool ();

            manaPool.Add (COLOR.Red, 2);
            manaPool.Add (COLOR.Green, 2);
            manaPool.Add (COLOR.Blue, 3);

            Assert.IsTrue (manaPool.Remove (COLOR.Red, 1));
            Assert.IsFalse (manaPool.Remove (COLOR.Red, 2));
            Assert.AreEqual (1, manaPool [COLOR.Red]);

            Assert.IsFalse (manaPool.Remove (COLOR.White, 1));
            Assert.IsFalse (manaPool.Remove (COLOR.Blue, 4));
        }
Example #4
0
        public void TestAdd()
        {
            var manaPool = new ManaPool ();

            manaPool.Add (COLOR.Red, 2);
            manaPool.Add (COLOR.Red, 2);
            manaPool.Add (COLOR.Blue, 3);
            foreach (var color in EnumUtil.GetValues<COLOR>()) {
                switch (color) {
                case COLOR.Red:
                    Assert.AreEqual (4, manaPool [color]);
                    break;
                case COLOR.Blue:
                    Assert.AreEqual (3, manaPool [color]);
                    break;
                default:
                    Assert.AreEqual (0, manaPool [color]);
                    break;
                }
            }
        }
Example #5
0
        public void TestInvalidRemove()
        {
            var manaPool = new ManaPool ();

            manaPool.Remove (COLOR.Black, -1);
        }
Example #6
0
        public void TestInvalidAdd()
        {
            var manaPool = new ManaPool ();

            manaPool.Add (COLOR.Black, -1);
        }
Example #7
0
		public Player(string name, Game game):base()
		{
			Name = name;
			Game = game;
			ManaPool = new ManaPool();
		}