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); }
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()); }
public void ReturnChit() { ChitBag c = new ChitBag(); var chit = c.DrawChit(); Assert.AreEqual(119, c.ChitsLeft()); c.ReturnChit(chit); Assert.AreEqual(120, c.ChitsLeft()); }
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); }
public void ChitBagSize() { ChitBag c = new ChitBag(); Assert.AreEqual(120, c.ChitsLeft()); }