Ejemplo n.º 1
0
        /**
         * No stack.  Empty stack.
         * Stack of 2.  2 stacks.
         */
        [Test] public void Power()
        {
            List <List <int> > stacks = new List <List <int> >();
            List <int>         stack  = new List <int>();

            Assert.AreEqual(0, Calculate.Power(stacks));
            stacks.Add(stack);
            Assert.AreEqual(0, Calculate.Power(stacks));
        }
Ejemplo n.º 2
0
        [Test] public void PlayCard()
        {
            Rule rule = new Rule();

            rule.contract  = 12;
            rule.theirHand = DataUtil.ToList(1, 3, 4, 5);
            rule.PlayCard(false, 4, 0);
            Assert.AreEqual(4, Calculate.Power(rule.theirField));
            rule.yourHand = DataUtil.ToList(1, 3, 4, 5);
            rule.PlayCard(true, 3, 0);
            Assert.AreEqual(3, Calculate.Power(rule.yourField));
        }
Ejemplo n.º 3
0
        public bool EqualsContract(bool you)
        {
            List <List <int> > field = you ? yourField : theirField;

            return(contract == Calculate.Power(field));
        }