public void TestRoll(int dices) { List <int> results = diceCup.Roll(dices); Assert.AreEqual(results.Count, dices); foreach (int i in results) { Assert.GreaterOrEqual(i, 1); Assert.LessOrEqual(i, 10); } }
protected void OnButtonRollClicked(object sender, EventArgs e) { List <int> results = diceCup.Roll((int)hscaleDices.Value); int difficulty = (int)hscaleDifficulty.Value; bool tensTwoSuccesses = checkbuttonTens.Active; string summary = diceCup.ParseRoll(results, difficulty, tensTwoSuccesses, out int successes, out int failures, out int botches); UpdateTextView(results); UpdateLabels(summary, successes, failures, botches); }
public void Run() { List <int> results = diceCup.Roll(dices); string summary = diceCup.ParseRoll(results, difficulty, tensTwoSuccesses, out int successes, out int failures, out int botches); string s = "[ "; foreach (int i in results) { s += i + " "; } s += "]"; Console.WriteLine(s + " (difficulty: " + difficulty + ")"); Console.WriteLine(summary + " --> Successes: " + successes + " Failures: " + failures + " Botches: " + botches); }