Beispiel #1
0
        public void ColorBetTest_Winning(int returnResult, uint amount, uint fieldNumber, uint fieldColor)
        {
            var field = new Field(fieldNumber, fieldColor);
            var uut   = new ColorBet("StubBet", amount, fieldColor);

            Assert.That(returnResult, Is.EqualTo(uut.WonAmount(field)));
        }
Beispiel #2
0
        public void WonAmount_FieldColorDoesNotEqualBetColor_ResultEqualsZero() // test for every color combination?
        {
            //Arrange
            ColorBet uut       = new ColorBet("Otto Leisner", 10, Field.Red); //amount = 10, color = 0
            Field    testField = new Field(5, Field.Black);                   // Number = 5, Color = 1

            //Act
            var returnValue = uut.WonAmount(testField);

            //Assert
            Assert.AreEqual(0, returnValue);
        }
Beispiel #3
0
        [Test] // red, black, green
        public void WonAmount_FieldColorIsGreenAndBetColorIsGreenAndAmountEquals10_ResultEquals20()
        {
            //Arrange
            ColorBet uut       = new ColorBet("Otto Leisner", 10, Field.Green); //amount = 10, color = 0
            Field    testField = new Field(25, Field.Green);                    // Number = 25, Color = 0

            //Act
            var returnValue = uut.WonAmount(testField);

            //Assert
            Assert.AreEqual(20, returnValue);
        }
Beispiel #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)));
        }
 public void GreenBet_DifferentFieldColors_WonAmountCorrect(FieldColor color, int wonAmount)
 {
     _stubField.Color.Returns(color);
     Assert.That(_uutGreen.WonAmount(_stubField), Is.EqualTo(wonAmount));
 }
 public void WonAmount_OnRed_GetMoney()
 {
     _cbTestObj = new ColorBet(_sName, _uiAmount, Field.Red);
     _fsFieldStub.Color = Field.Red;
     Assert.Greater(_cbTestObj.WonAmount(_fsFieldStub), 0);
 }
Beispiel #7
0
 [TestCase(Field.Red, 0)]   // ingen gevinst på rød
 public void GreenBet_differentFieldColors_WonAmountIsCorrect(uint Color, int wonAmount)
 {
     _stubField.Color = Color;
     Assert.That(_uutGreen.WonAmount(_stubField), Is.EqualTo(wonAmount));
 }
Beispiel #8
0
        public void Abstract_Bet_GetAmount()
        {
            Bet uut = new ColorBet("Colorbet", 50u, Field.Black);

            Assert.That(uut.WonAmount(new Field(20u, Field.Black)), Is.EqualTo(100u));
        }
Beispiel #9
0
 public void ColorBet_BetIsWon_WonAmountIsCorrect()
 {
     Assert.That(_colorBet.WonAmount(_winField), Is.EqualTo(2 * BetAmount));
 }
Beispiel #10
0
 public void WonAmount_ColorChosen_CorrectAmount(string name, uint amount, uint color, uint expectedReturn)
 {
     _uut = new ColorBet(name, amount, color);
     Assert.That(_uut.WonAmount(new Field(2, color)), Is.EqualTo(expectedReturn));
 }