Ejemplo n.º 1
0
        public void RouletteTest_No_Spin_Result_0_Green()
        {
            var uut = new RouletteGame.Legacy.Roulette();

            Assert.That(uut.GetResult().Number, Is.EqualTo(new Field(0, Field.Green).Number));
            Assert.That(uut.GetResult().Color, Is.EqualTo(new Field(0, Field.Green).Color));
        }
Ejemplo n.º 2
0
        public void RouletteTest_Spin_Has_Been_Called()
        {
            var randomEngine = new RouletteGame.Legacy.Random();
            var uut          = new RouletteGame.Legacy.Roulette(randomEngine);

            uut.Spin();

            Assert.That(randomEngine.hasbeenCalled, Is.EqualTo(true));
        }
Ejemplo n.º 3
0
        public void RouletteTest_Spin_GetResult(uint numberToSpin, uint expectedResult, uint expectedColor)
        {
            var uut = new RouletteGame.Legacy.Roulette(new StubRandom(numberToSpin));

            uut.Spin();

            var winnerField = new Field(expectedResult, expectedColor);

            Assert.That(uut.GetResult().Number, Is.EqualTo(winnerField.Number));
            Assert.That(uut.GetResult().Color, Is.EqualTo(winnerField.Color));
        }