Ejemplo n.º 1
0
        public bool WhenWinThresholdIsReached_HasWinningThresholdBeenReached_ReturnsTrue(int winnings)
        {
            var coinService    = new CoinService();
            var currentBalance = new CoinBalance(4);

            var winningBalance = coinService.Accumulate(currentBalance, winnings);

            return(coinService.HasWinningThresholdBeenReached(winningBalance));
        }
Ejemplo n.º 2
0
        public void GivenValidInitialBalance_WhenAccumulating_FinalBalance_IsSumOfInitialValueAndWinnings(int initial, int winnings)
        {
            var coinService    = new CoinService();
            var initialBalance = new CoinBalance(initial);

            var finalBalance = coinService.Accumulate(initialBalance, winnings);

            Assert.That(finalBalance, Is.EqualTo(new CoinBalance(initial + winnings)));
        }
Ejemplo n.º 3
0
        public void NegativeValues_AreForbidden_WhenAccumulating(int invalidWinnings)
        {
            var coinService = new CoinService();

            Assert.Throws <ArgumentException>(
                () =>
            {
                var x = coinService.Accumulate(CoinBalance.Empty, invalidWinnings);
            });
        }