예제 #1
0
 public void CaoCaoAbtestnomockhealthless0()
 {
     {
         Attack card   = new Attack(CardSuit.Club, 1);
         IGame  game   = mocks.Stub <IGame>();
         int    health = -1;
         int    harm   = 1;
         Player p      = new CaoCao(1);
         int    old    = p.handCards.Count;
         p.health = -1;
         PhaseList ret  = p.harm(new HarmPhase(p, null, harm, card), game);
         int       newc = p.handCards.Count;
     }
 }
예제 #2
0
        public void CaoCaoAbtestnomocknull()
        {
            {
                Attack    card   = new Attack(CardSuit.Club, 1);
                IGame     game   = mocks.Stub <IGame>();
                int       health = 5;
                int       harm   = 1;
                Player    p      = new CaoCao(1);
                int       old    = p.handCards.Count;
                PhaseList ret    = p.harm(null, game);
                int       newc   = p.handCards.Count;


                Assert.IsTrue(old + 1 == newc);
            }
        }
예제 #3
0
        public void CaoCaoAbtestmock()
        {
            Player    p        = new CaoCao(1);
            Player    p2       = new ZhangFei(2);
            int       harm     = 1;
            Attack    fakeCard = mocks.DynamicMock <Attack>(CardSuit.Club, (byte)1);
            IGame     fakeGame = mocks.DynamicMock <IGame>();
            HarmPhase fakeharm = mocks.DynamicMock <HarmPhase>(p, p2, harm, fakeCard);


            int old = p.handCards.Count;

            using (mocks.Ordered())
            {
                p.handCards.Add(fakeCard);
            }
            mocks.ReplayAll();
            PhaseList ret  = p.harm(new HarmPhase(p, null, harm, fakeCard), fakeGame);
            int       newc = p.handCards.Count;

            Assert.IsTrue(old != newc);
        }