Пример #1
0
 public void Ensure_that_you_cannot_wash_things_if_you_are_holding_non_washable_stuff()
 {
     Avatar avatar = new Avatar();
     BagOfHolding bag = new BagOfHolding();
     Fork fork = new Fork();
     avatar.PickUp(bag);
     avatar.PickUp(fork);
     avatar.StartWashing();
 }
Пример #2
0
        static void Main(string[] args)
        {
            IContainer container = new Inventory(5);

            container.AddItem(new Sword());
            container.AddItem(new Sheild());
            container.AddItem(new Potion());
            IContainer bag = new BagOfHolding(5);

            bag.AddItem(new Sheild());
            bag.AddItem(new Sheild());
            bag.AddItem(new Sword());

            Console.WriteLine("Total weight is: " + bag.TotalWeight());
            Console.WriteLine("Total count is : " + bag.TotalCount());



            Console.ReadLine();
        }
Пример #3
0
        public void Ensure_that_you_cannot_fill_a_bag_of_holding_with_beer()
        {
            Avatar avatar = new Avatar();
            BagOfHolding bag = new BagOfHolding();
            avatar.PickUp(bag);

            Fridge fridge = new Fridge();
            avatar.DispenseBeerFrom(fridge).Into(bag);
        }