public void RouletteGame_Check_Getresult() { var _fakeRoulette = Substitute.For <IRoulette>(); var uut = new RouletteGame.Legacy.RouletteGame(_fakeRoulette); uut.SpinRoulette(); _fakeRoulette.Received(1).GetResult(); }
public void RouletteSpin() { var roulette = new FakeRoulette(); var uut = new RouletteGame.Legacy.RouletteGame(roulette); uut.SpinRoulette(); Assert.That(roulette.SpinFuntionWasCalled, Is.EqualTo(true)); }
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); }
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))); }
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))); } }
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(); }
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(); }