Exemplo n.º 1
0
        public void Test_AddTyre()
        {
            int savedId = Product.GetNextAvailableId();

            Assert.IsTrue(Tyre.AddNewTyre(new Tyre
                                              (savedId, "215/55X20 DSI JAPAN TYRE", "DSI", "215/55X20", "JAPAN", 1000, 1)));
        }
Exemplo n.º 2
0
        public void Test_GetTyre()
        {
            int  savedId  = Product.GetNextAvailableId();
            Tyre testTyre = new Tyre
                                (savedId, "215/55X21 DSI JAPAN TYRE", "DSI", "215/55X21", "JAPAN", 1000, 1);

            Tyre.AddNewTyre(testTyre);

            Assert.AreEqual
                (testTyre.Name, Tyre.GetTyres(id: savedId.ToString()).ElementAt(0).Name);
            Assert.AreEqual
                (testTyre.Name, Tyre.GetTyres(name: testTyre.Name).ElementAt(0).Name);
        }
Exemplo n.º 3
0
        private bool AddNewItemInfo()
        {
            switch (_selectedItemType)
            {
            case "Tyre":
                return(Tyre.AddNewTyre((Tyre)_selectedItem));

            case "Alloy Wheel":
                return(AlloyWheel.AddNewAlloyWheel((AlloyWheel)_selectedItem));

            case "Battery":
                return(Battery.AddNewBattery((Battery)_selectedItem));
            }

            return(false);
        }