Exemplo n.º 1
0
        async public void ShouldPlay()
        {
            var runnerCards = new List <Card>();

            for (int i = 0; i < 5; i++)
            {
                runnerCards.Add(new SureGamble());
            }
            var sureGamble = runnerCards.First();
            var game       = new MockGames().WithRunnerCards(runnerCards);

            game.Start();
            await new PassiveCorp(game).SkipTurn();
            var balance = new LastBalanceObserver();
            var clicks  = new SpentClicksObserver();
            var grip    = new GripObserver();
            var heap    = new HeapObserver();

            game.runner.credits.Observe(balance);
            game.runner.clicks.Observe(clicks);
            game.runner.zones.grip.zone.ObserveRemovals(grip);
            game.runner.zones.heap.zone.ObserveAdditions(heap);

            await game.runner.actionCard.TakeAction();

            await game.runner.actionCard.Play(sureGamble).Trigger(game);

            Assert.AreEqual(9, balance.LastBalance);
            Assert.AreEqual(1, clicks.Spent);
            Assert.AreEqual(sureGamble, grip.LastRemoved);
            Assert.AreEqual(sureGamble, heap.LastAdded);
        }
        async public void ShouldClickForCredit()
        {
            var game        = new MockGames().WithRunnerCards(new List <Card>());
            var gameFlowLog = new GameFlowLog();

            gameFlowLog.Display(game);
            game.Start();
            var balance = new LastBalanceObserver();
            var clicks  = new SpentClicksObserver();

            game.corp.credits.Observe(balance);
            game.corp.clicks.Observe(clicks);
            var clickForCredit = game.corp.actionCard.credit;

            SkipPaidWindow(game);
            SkipPaidWindow(game);

            await game.corp.actionCard.TakeAction();

            await clickForCredit.Trigger(game);

            Assert.AreEqual(6, balance.LastBalance);
            Assert.AreEqual(1, clicks.Spent);
        }