コード例 #1
0
        public void CannotAddBigItems()
        {
            Satchel     bag   = new Satchel();
            WoodenSword sword = new WoodenSword();
            BattleAxe   axe   = new BattleAxe();

            bag.AddItem(sword);
            bag.AddItem(axe);

            Assert.AreEqual(1, bag.ItemCount);

            bag.DisplayContents();
        }
コード例 #2
0
        public void CanAddLittleItems()
        {
            Satchel     bag   = new Satchel();
            Boomerang   rang  = new Boomerang();
            WoodenSword sword = new WoodenSword();

            bag.AddItem(rang);
            bag.AddItem(sword);

            Assert.AreEqual(2, bag.ItemCount);

            bag.DisplayContents();
        }