예제 #1
0
        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();
        }
예제 #2
0
        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]);
        }