示例#1
0
文件: MapTests.cs 项目: pvh/dominate
 public void DrawSpecificChit()
 {
     ChitBag c = new ChitBag();
     var chit = c.DrawChit();
     Assert.AreEqual(119, c.ChitsLeft());
     Assert.IsNotNull(chit);
     Assert.AreNotEqual(Chit.ElementType.Invalid, chit.Element);
     Assert.AreNotEqual(Chit.ElementType.None, chit.Element);
 }
示例#2
0
文件: MapTests.cs 项目: pvh/dominate
 public void CountContents()
 {
     ChitBag c = new ChitBag();
     List<Chit> chits = new List<Chit> {};
     for (int i = 0; i < 120; i++) {
         chits.Add(c.DrawChit());
     }
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Grass));
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Grub));
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Meat));
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Seed));
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Sun));
     Assert.AreEqual(20, chits.Count(i => i.Element == Chit.ElementType.Water));
     Assert.AreEqual(0, c.ChitsLeft());
 }
示例#3
0
文件: MapTests.cs 项目: pvh/dominate
        public void ReturnChit()
        {
            ChitBag c = new ChitBag();
            var chit = c.DrawChit();
            Assert.AreEqual(119, c.ChitsLeft());

            c.ReturnChit(chit);
            Assert.AreEqual(120, c.ChitsLeft());
        }
示例#4
0
文件: MapTests.cs 项目: pvh/dominate
        public void DrawTooMany()
        {
            ChitBag c = new ChitBag();
            for (int i = 0; i < 120; i++) {
                c.DrawChit();
            }
            Assert.AreEqual(0, c.ChitsLeft());

            var chit = c.DrawChit();
            Assert.AreEqual(null, chit);
        }
示例#5
0
文件: MapTests.cs 项目: pvh/dominate
 public void ChitBagSize()
 {
     ChitBag c = new ChitBag();
     Assert.AreEqual(120, c.ChitsLeft());
 }