public void FjernlagerOrderTest() { Bike bike = new Bike(2, "TestBike", "TestFirma", "Gul", 19999.99M, "En test cykel!"); BikeShop bs = new BikeShop("TestShop", "TestArea", 0000); Fjernlager.AddToStock(bike, 10); Assert.False(bs.BikeDict.ContainsKey(bike)); bs.OrderBikesFromStorage(bike, 10); Assert.That(bs.BikeDict.ContainsKey(bike)); Assert.AreEqual(10, bs.BikeDict[bike]); }
public void FjernlagerRestockTest() { Bike bike = new Bike(2, "TestBike", "TestFirma", "Gul", 19999.99M, "En test cykel!"); int quantity = 10; if (Fjernlager.BikeDict.ContainsKey(bike)) { quantity += Fjernlager.BikeDict[bike]; } Fjernlager.AddToStock(bike, quantity); Assert.That(Fjernlager.BikeDict.ContainsKey(bike)); Assert.AreEqual(Fjernlager.BikeDict[bike], quantity); Fjernlager.AddToStock(bike, 5); Assert.AreEqual(Fjernlager.BikeDict[bike], quantity + 5); }