Example #1
0
 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);
 }
Example #2
0
 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());
 }
Example #3
0
        public void ReturnChit()
        {
            ChitBag c = new ChitBag();
            var chit = c.DrawChit();
            Assert.AreEqual(119, c.ChitsLeft());

            c.ReturnChit(chit);
            Assert.AreEqual(120, c.ChitsLeft());
        }
Example #4
0
        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);
        }
Example #5
0
 public void ChitBagSize()
 {
     ChitBag c = new ChitBag();
     Assert.AreEqual(120, c.ChitsLeft());
 }