Пример #1
0
        public void Add_Item_To_Existing_Catalogue()
        {
            ICatalogueItem        item1 = new FakeCatalogueItem1();
            ICatalogueItem        item2 = new FakeCatalogueItem1();
            ICatalogueItem        item3 = new FakeCatalogueItem1();
            List <ICatalogueItem> items = new List <ICatalogueItem>()
            {
                item1, item2, item3
            };
            IItem fakeItem1 = new FakeItem();

            item1.Add(fakeItem1);

            IVendingMachineInternal fakeMachine = new FakeVendingMachine();
            ICatalogue catalogue = new SimpleCatalogue();

            catalogue.Init(fakeMachine);
            catalogue.Setup(items);


            IItem fakeItem2 = new FakeItem();

            catalogue.AddItem(fakeItem2);

            Assert.That(catalogue.ContainsItem(fakeItem2).Equals(true));
        }
Пример #2
0
        public void Check_Catalogue_For_A_Given_Catalogue()
        {
            ICatalogueItem        item1 = new FakeCatalogueItem1();
            ICatalogueItem        item2 = new FakeCatalogueItem1();
            ICatalogueItem        item3 = new FakeCatalogueItem1();
            List <ICatalogueItem> items = new List <ICatalogueItem>()
            {
                item1, item2, item3
            };

            IVendingMachineInternal fakeMachine = new FakeVendingMachine();
            ICatalogue catalogue = new SimpleCatalogue();

            catalogue.Init(fakeMachine);
            catalogue.Setup(items);

            Assert.That(items.Equals(catalogue.GetCatalogueItems()));
        }