public void testTotal() { ScoringCategoryFactory factory = new ScoringCategoryFactory(); ScoringCategory cat = factory.makeTotal("My Total", 42); Assert.AreEqual("My Total", cat.Name); Assert.AreEqual(42, cat.FinalScore); }
public List<ScoringCategory> printScoreSheet() { List<ScoringCategory> result = new List<ScoringCategory>(); ScoringCategoryFactory factory = new ScoringCategoryFactory(); bool onUpper = true; foreach (ScoringCategory cat in ScoringCategories) { if (onUpper & cat.Lower) { onUpper = false; result.Add(factory.makeTotal("Upper Total", getUpperScore())); if (useBonus) result.Add(factory.makeTotal("Upper Bonus", Bonus)); } result.Add(cat); } result.Add(factory.makeTotal("Lower Total", getLowerScore())); if (BonusYahtzeeAmount > 0) result.Add(factory.makeTotal("Bonus Yahtzee Total", BonusYahtzeeAmount * ExtraYahtzees)); result.Add(factory.makeTotal("Total", CurrentScore())); return result; }
public void testBlankRules() { ScoringCategoryFactory factory = new ScoringCategoryFactory(); ScoringCategory cat = factory.makeTotal("My Total", 0); Assert.AreEqual("", cat.getRules()); }