コード例 #1
0
        public void RouletteGame_Check_Getresult()
        {
            var _fakeRoulette = Substitute.For <IRoulette>();
            var uut           = new RouletteGame.Legacy.RouletteGame(_fakeRoulette);

            uut.SpinRoulette();

            _fakeRoulette.Received(1).GetResult();
        }
コード例 #2
0
ファイル: TestSuite.cs プロジェクト: Unsongheroes/SWT_45_repo
        public void RouletteSpin()
        {
            var roulette = new FakeRoulette();
            var uut      = new RouletteGame.Legacy.RouletteGame(roulette);

            uut.SpinRoulette();

            Assert.That(roulette.SpinFuntionWasCalled, Is.EqualTo(true));
        }
コード例 #3
0
        public void TestFakeSpin()
        {
            var RL = new FakeRoulette();

            RouletteGame.Legacy.RouletteGame RG = new RouletteGame.Legacy.RouletteGame(RL);
            RG.OpenBets();
            RG.PlaceBet(new ColorBet("player 1", 100, Field.Black));
            RG.CloseBets();
            RG.SpinRoulette();
            Assert.AreEqual(1, RL.CountGetResult);
        }
コード例 #4
0
        public void CanBlackWin()
        {
            Field field = new Field(1, 1);
            var   game  = new RouletteGame.Legacy.RouletteGame(new FakeRoulette(field));

            game.OpenBets();
            Bet bet = new ColorBet("Fake Player", 100, 1);

            game.PlaceBet(bet);
            game.CloseBets();
            game.SpinRoulette();
            game.PayUp();
            Assert.That(game.FakePayUp(bet).Equals(bet.WonAmount(field)));
        }
コード例 #5
0
 public void CanAllFieldWin()
 {
     for (uint i = 0; i < 37; i++)
     {
         Field field = new Field(i, 0);
         var   game  = new RouletteGame.Legacy.RouletteGame(new FakeRoulette(field));
         game.OpenBets();
         Bet bet = new FieldBet("Fake Player", 100, i);
         game.PlaceBet(bet);
         game.CloseBets();
         game.SpinRoulette();
         game.PayUp();
         Assert.That(game.FakePayUp(bet).Equals(bet.WonAmount(field)));
     }
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: maxdenstore/RouletteGame
        static void Main(string[] args)
        {
            var game = new RouletteGame(new Roulette(new Randomzier(), new FieldFactory()));

            game.OpenBets();
            game.PlaceBet(new ColorBet("Player 1", 100, Field.Black));
            game.PlaceBet(new ColorBet("Player 1", 100, Field.Red));

            game.PlaceBet(new EvenOddBet("Player 2", 100, true));
            game.PlaceBet(new EvenOddBet("Player 2", 100, false));

            for (uint i = 0; i < 36; i++)
            {
                game.PlaceBet(new FieldBet("Player 3", 100, i));
            }

            game.CloseBets();
            game.SpinRoulette();
            game.PayUp();
        }
コード例 #7
0
        private static void Main()
        {
            var game = new RouletteGame(new Roulette());

            game.OpenBets();
            game.PlaceBet(new ColorBet("Player 1", 100, Field.Black));
            game.PlaceBet(new ColorBet("Player 1", 100, Field.Red));


            game.PlaceBet(new EvenOddBet("Player 2", 100, true));
            game.PlaceBet(new EvenOddBet("Player 2", 100, false));

            for (uint i = 0; i < 36; i++)
            {
                game.PlaceBet(new FieldBet("Player 3", 100, i));
            }

            game.CloseBets();
            game.SpinRoulette();
            game.PayUp();
        }