static void Main(string[] args) { Bike bike = new Bike(2, "TestBike", "TestFirma", "Gul", 19999.99M, "En test cykel!"); BikeShop bs = new BikeShop("TestShop", "TestArea", 0000); bs.AddBike(bike); bs.UpdateBike(bike, "Ny description!", 5.0M); Bike updatedBike = new Bike(2, "TestBike", "TestFirma", "Gul", 5.0M, "Ny description!"); if (bs.BikeDict.ContainsKey(bike)) { Console.WriteLine("no"); } else { Console.WriteLine("yes"); } bs.OrderBikesFromStorage(bike, 10); Console.Read(); }
public void UpdateBikeTest() { Bike bike = new Bike(2, "TestBike", "TestFirma", "Gul", 19999.99M, "En test cykel!"); Bike originalBike = new Bike(2, "TestBike", "TestFirma", "Gul", 19999.99M, "En test cykel!"); BikeShop bs = new BikeShop("TestShop", "TestArea", 0000); bs.AddBike(bike); Assert.That(bs.BikeDict.ContainsKey(bike)); bs.UpdateBike(bike, "Ny description!", 5.0M); Assert.That(bs.BikeDict.ContainsKey(bike)); Assert.False(bs.BikeDict.ContainsKey(originalBike)); }