public void Roll_StaysWithinBounds() { var diceTray = new DiceTray("d20", "1", "0", VantageType.NoVantage); var actual = diceTray.Rolls; Assert.InRange(actual[0], 1, 20); }
public void VantageType_LimitsDiceCount(VantageType vantageType) { var diceTray = new DiceTray("d20", "5", "0", vantageType); int expected = 2; var actual = diceTray.DiceCount; Assert.Equal(expected, actual); }
public void Roll_LengthIsSetByDice(string diceCount) { var diceTray = new DiceTray("d20", diceCount, "0", VantageType.NoVantage); int expected = int.Parse(diceCount); var actual = diceTray.Rolls.Length; Assert.Equal(expected, actual); }
private void RollButton_Click(object sender, RoutedEventArgs e) { VantageType vantageType = GetVantage(); var diceTray = new DiceTray(diceSelector.Text, diceCount.Text, modifier.Text, vantageType); var rollMessage = new RollMessage(diceTray); string message = $"You Rolled {rollMessage.RollMade}\n" + $"Your rolls were {rollMessage.Rolls}\n" + $"Result = {rollMessage.Result}"; MessageBox.Show(this, message, rollMessage.CritMessage); }