コード例 #1
0
        public void ShouldReturn5Values()
        {
            Dice sut    = new DiceImplemented(new DieImplemented(), new DieImplemented(), new DieImplemented(), new DieImplemented(), new DieImplemented());
            var  actual = sut.GetValues().Count;

            var expected = 5;

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void ShouldGetValuesFromDice()
        {
            var die1 = new Mock <Die>();
            var die2 = new Mock <Die>();
            var die3 = new Mock <Die>();
            var die4 = new Mock <Die>();
            var die5 = new Mock <Die>();

            die1.Setup(die => die.GetValue()).Returns(5);
            die2.Setup(die => die.GetValue()).Returns(5);
            die3.Setup(die => die.GetValue()).Returns(5);
            die4.Setup(die => die.GetValue()).Returns(5);
            die5.Setup(die => die.GetValue()).Returns(5);

            Dice sut = new DiceImplemented(die1.Object, die2.Object, die3.Object, die4.Object, die5.Object);

            var actual   = sut.GetValues().Sum();
            var expected = 25;

            Assert.Equal(expected, actual);
        }