Beispiel #1
0
 public void AddItemToShop()
 {
     Item item = new Item("ID0001", "Cestitka 1");
     Shop shop = new Shop("trgovina 1");
     Price price = new Price(4, 3.2) {ItemId = item.UniqueId, ShopId = shop.Id};
     ShopItem shopItem = new ShopItem {ItemId = item.UniqueId, ShopId = shop.Id, PriceId = price.Id};
     Assert.IsNotNull(shopItem, "Items not added to shop!");
     shopItem.SetNumberOfItems(3);
     Assert.AreEqual(3, shopItem.NumberOfItems, "ShopItem missmatch!");
     Overview overview = new Overview();
     overview.AddShopItem(shopItem);
     Overview temp = overview;
 }
Beispiel #2
0
 public void Setup()
 {
     dataBase.DeleteAllItems();
     dataBase.DeleteAllItemTypes();
     dataBase.DeleteAllShops();
     itemType = new ItemType {Name = ItemTypeName};
     Assert.IsTrue(dataBase.InsertItemType(itemType));
     IList<ItemType> itemTypes = dataBase.GetItemTypes();
     const string shopName = "trgovina 1";
     shop = new Shop(shopName)
         {Address = "asdasd", City = "assdf fs", IsCompany = true, Owner = "asdfaf safwefase", PostalCode = 1234};
     Assert.IsTrue(dataBase.InsertShop(shop));
     item = new Item("ID00001", "item 1")
         {
             ItemType = itemTypes[0].Id,
             Notes = "bla bla bal...",
         };
     Assert.IsTrue(dataBase.InsertItem(item));
     price = new Price(1.2, 1.1) {ItemId = item.UniqueId, ShopId = shop.Id};
     Assert.IsTrue(dataBase.InsertPrice(price));
     DateTime dateTime = new DateTime(DateTime.Now.Ticks);
     shopItem = new ShopItem {ItemId = item.UniqueId, ShopId = shop.Id, PriceId = price.Id, DateTime = dateTime};
     shopItem.SetNumberOfItems(5);
     Assert.IsTrue(dataBase.InsertShopItem(shopItem));
     tracker = new Tracker(shopItem) {SoldCount = 2, DateTime = dateTime};
     Assert.IsTrue(dataBase.InsertTracker(tracker));
 }