public DiceRollModel(int die, int sides, int rollModifier, int totalModifier) { Die = die; Sides = sides; RollModifier = rollModifier; TotalModifier = totalModifier; Rolls = DiceService.Roll(die, sides, rollModifier); Total = Accumulate(Rolls) + TotalModifier; Description = ToString(); }
public void DiceWithSixOnceSuccessfully() { diceService = new DiceService(); DiceThrowVM result; result = diceService.Roll(6, 1); Assert.True(result.Result[0] <= 6); Assert.True(result.Result[0] >= 0); }
public int AwardBonusMoves(DiceService diceService, RobotDifficulty difficulty) { if (difficulty != RobotDifficulty.Difficult) { return(0); } var bonusMoves = diceService.Roll(3); MovesRemaining = MovesRemaining + bonusMoves; return(bonusMoves); }
public void Should_roll_dice_multiple_times(int times, int sides, int expected) { var random = Mock.Create <IRandomHelper>(); Mock.Arrange(() => random.Next()).Occurs(times); var roller = new DiceService(random); var totalRoll = roller.Roll(times, sides); Assert.AreEqual(expected, totalRoll); }
public int Attack(DiceService diceService) { return(diceService.Roll(DamageMaximum)); }