public void TestSoups()
        {
            ListOfDishes list      = new ListOfDishes();
            List <Dish>  listPizza = list.LoadListSoups();

            Assert.AreEqual("Pomidorowa", listPizza[0].Name);
            Assert.AreEqual("12zł", listPizza[0].Price);

            Assert.AreEqual("Rosół", listPizza[1].Name);
            Assert.AreEqual("10zł", listPizza[1].Price);
        }
Exemple #2
0
        public void TestListDishesSoups()
        {
            Order        order = new Order();
            ListOfDishes list  = new ListOfDishes();

            order.ListDishes = list.LoadListSoups();

            Assert.AreEqual("Pomidorowa", order.ListDishes[0].Name);
            Assert.AreEqual("12zł", order.ListDishes[0].Price);

            Assert.AreEqual("Rosół", order.ListDishes[1].Name);
            Assert.AreEqual("10zł", order.ListDishes[1].Price);
        }
 public void LoadSoups()
 {
     AddDishesToListView(listOfDishes.LoadListSoups());
     ClearCheckedListBox();
 }
Exemple #4
0
        public void TestSaveOrderList()
        {
            TCreateTabeles createSql = new TCreateTabeles();

            createSql.CreateSQLiteTables();
            TInsertAndQuestionSQL sql = new TInsertAndQuestionSQL();

            sql.RemoveAllTask();

            ListOfDishes listOfDishes = new ListOfDishes();

            Order order = new Order
            {
                ListDishes = listOfDishes.LoadListPizza()
            };

            string date = DateTime.Now.ToString();

            order.PriceAll.Date = date;

            List <Order> lOrder = new List <Order>
            {
                order
            };

            TSave save = new TSave();

            save.SaveOrderList(TSave.ChoiceSaveOrder.Sql, lOrder);

            TLoadOrder   load    = new TLoadOrder();
            List <Order> loadSql = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Sql);

            Assert.AreEqual(lOrder[0].PriceAll.Comments, loadSql[0].PriceAll.Comments);
            Assert.AreEqual(lOrder[0].PriceAll.Date, loadSql[0].PriceAll.Date);
            Assert.AreEqual(lOrder[0].PriceAll.Price, loadSql[0].PriceAll.Price);

            Assert.AreEqual(lOrder[0].ListDishes[0].Name, loadSql[0].ListDishes[0].Name);
            Assert.AreEqual("Margheritta", loadSql[0].ListDishes[0].Name);
            Assert.AreEqual(lOrder[0].ListDishes[0].Price, loadSql[0].ListDishes[0].Price);
            Assert.AreEqual(lOrder[0].ListDishes[0].SidesDishes, loadSql[0].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[1].Name, loadSql[0].ListDishes[1].Name);
            Assert.AreEqual(lOrder[0].ListDishes[1].Price, loadSql[0].ListDishes[1].Price);
            Assert.AreEqual(lOrder[0].ListDishes[1].SidesDishes, loadSql[0].ListDishes[1].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[2].Name, loadSql[0].ListDishes[2].Name);
            Assert.AreEqual(lOrder[0].ListDishes[2].Price, loadSql[0].ListDishes[2].Price);
            Assert.AreEqual(lOrder[0].ListDishes[2].SidesDishes, loadSql[0].ListDishes[2].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[3].Name, loadSql[0].ListDishes[3].Name);
            Assert.AreEqual(lOrder[0].ListDishes[3].Price, loadSql[0].ListDishes[3].Price);
            Assert.AreEqual(lOrder[0].ListDishes[3].SidesDishes, loadSql[0].ListDishes[3].SidesDishes);



            order.ListDishes    = listOfDishes.LoadListMainDish();
            date                = DateTime.Now.ToString();
            order.PriceAll.Date = date;
            lOrder.Add(order);
            save.SaveOrderList(TSave.ChoiceSaveOrder.Sql, lOrder);
            loadSql = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Sql);

            Assert.AreEqual(lOrder[1].PriceAll.Comments, loadSql[1].PriceAll.Comments);
            Assert.AreEqual(lOrder[1].PriceAll.Date, loadSql[1].PriceAll.Date);
            Assert.AreEqual(lOrder[1].PriceAll.Price, loadSql[1].PriceAll.Price);

            Assert.AreEqual(lOrder[1].ListDishes[0].Name, loadSql[1].ListDishes[0].Name);
            Assert.AreEqual("Schabowy z frytkami/ryżem/ziemniakami", loadSql[1].ListDishes[0].Name);
            Assert.AreEqual(lOrder[1].ListDishes[0].Price, loadSql[1].ListDishes[0].Price);
            Assert.AreEqual(lOrder[1].ListDishes[0].SidesDishes, loadSql[1].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[1].ListDishes[1].Name, loadSql[1].ListDishes[1].Name);
            Assert.AreEqual(lOrder[1].ListDishes[1].Price, loadSql[1].ListDishes[1].Price);
            Assert.AreEqual(lOrder[1].ListDishes[1].SidesDishes, loadSql[1].ListDishes[1].SidesDishes);

            Assert.AreEqual(lOrder[1].ListDishes[2].Name, loadSql[1].ListDishes[2].Name);
            Assert.AreEqual(lOrder[1].ListDishes[2].Price, loadSql[1].ListDishes[2].Price);
            Assert.AreEqual(lOrder[1].ListDishes[2].SidesDishes, loadSql[1].ListDishes[2].SidesDishes);


            order.ListDishes    = listOfDishes.LoadListSoups();
            date                = DateTime.Now.ToString();
            order.PriceAll.Date = date;
            lOrder.Add(order);
            save.SaveOrderList(TSave.ChoiceSaveOrder.Sql, lOrder);
            loadSql = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Sql);

            Assert.AreEqual(lOrder[2].PriceAll.Comments, loadSql[2].PriceAll.Comments);
            Assert.AreEqual(lOrder[2].PriceAll.Date, loadSql[2].PriceAll.Date);
            Assert.AreEqual(lOrder[2].PriceAll.Price, loadSql[2].PriceAll.Price);

            Assert.AreEqual(lOrder[2].ListDishes[0].Name, loadSql[2].ListDishes[0].Name);
            Assert.AreEqual("Pomidorowa", loadSql[2].ListDishes[0].Name);
            Assert.AreEqual(lOrder[2].ListDishes[0].Price, loadSql[2].ListDishes[0].Price);
            Assert.AreEqual(lOrder[2].ListDishes[0].SidesDishes, loadSql[2].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[2].ListDishes[1].Name, loadSql[2].ListDishes[1].Name);
            Assert.AreEqual(lOrder[2].ListDishes[1].Price, loadSql[2].ListDishes[1].Price);
            Assert.AreEqual(lOrder[2].ListDishes[1].SidesDishes, loadSql[2].ListDishes[1].SidesDishes);
        }
Exemple #5
0
        public void TestSaveOrderList()
        {
            TSaveFiles saveFiles = new TSaveFiles();

            saveFiles.CleanFilesTxt();

            ListOfDishes listOfDishes = new ListOfDishes();
            Order        order        = new Order
            {
                ListDishes = listOfDishes.LoadListPizza()
            };



            string date = DateTime.Now.ToString();

            order.PriceAll.Date = date;

            List <Order> lOrder = new List <Order>
            {
                order
            };

            TSave save = new TSave();

            save.SaveOrderList(TSave.ChoiceSaveOrder.Txt, lOrder);

            TLoadOrder   load    = new TLoadOrder();
            List <Order> loadTxt = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Txt);

            Assert.AreEqual(lOrder[0].PriceAll.Comments, loadTxt[0].PriceAll.Comments);
            Assert.AreEqual(lOrder[0].PriceAll.Date, loadTxt[0].PriceAll.Date);
            Assert.AreEqual(lOrder[0].PriceAll.Price, loadTxt[0].PriceAll.Price);

            Assert.AreEqual(lOrder[0].ListDishes[0].Name, loadTxt[0].ListDishes[0].Name);
            Assert.AreEqual("Margheritta", loadTxt[0].ListDishes[0].Name);
            Assert.AreEqual(lOrder[0].ListDishes[0].Price, loadTxt[0].ListDishes[0].Price);
            Assert.AreEqual(lOrder[0].ListDishes[0].SidesDishes, loadTxt[0].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[1].Name, loadTxt[0].ListDishes[1].Name);
            Assert.AreEqual(lOrder[0].ListDishes[1].Price, loadTxt[0].ListDishes[1].Price);
            Assert.AreEqual(lOrder[0].ListDishes[1].SidesDishes, loadTxt[0].ListDishes[1].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[2].Name, loadTxt[0].ListDishes[2].Name);
            Assert.AreEqual(lOrder[0].ListDishes[2].Price, loadTxt[0].ListDishes[2].Price);
            Assert.AreEqual(lOrder[0].ListDishes[2].SidesDishes, loadTxt[0].ListDishes[2].SidesDishes);

            Assert.AreEqual(lOrder[0].ListDishes[3].Name, loadTxt[0].ListDishes[3].Name);
            Assert.AreEqual(lOrder[0].ListDishes[3].Price, loadTxt[0].ListDishes[3].Price);
            Assert.AreEqual(lOrder[0].ListDishes[3].SidesDishes, loadTxt[0].ListDishes[3].SidesDishes);


            order.ListDishes    = listOfDishes.LoadListMainDish();
            date                = DateTime.Now.ToString();
            order.PriceAll.Date = date;
            lOrder.Add(order);
            save.SaveOrderList(TSave.ChoiceSaveOrder.Txt, lOrder);
            loadTxt = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Txt);

            Assert.AreEqual(lOrder[1].PriceAll.Comments, loadTxt[1].PriceAll.Comments);
            Assert.AreEqual(lOrder[1].PriceAll.Date, loadTxt[1].PriceAll.Date);
            Assert.AreEqual(lOrder[1].PriceAll.Price, loadTxt[1].PriceAll.Price);

            Assert.AreEqual(lOrder[1].ListDishes[0].Name, loadTxt[1].ListDishes[0].Name);
            Assert.AreEqual("Schabowy z frytkami/ryżem/ziemniakami", loadTxt[1].ListDishes[0].Name);
            Assert.AreEqual(lOrder[1].ListDishes[0].Price, loadTxt[1].ListDishes[0].Price);
            Assert.AreEqual(lOrder[1].ListDishes[0].SidesDishes, loadTxt[1].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[1].ListDishes[1].Name, loadTxt[1].ListDishes[1].Name);
            Assert.AreEqual(lOrder[1].ListDishes[1].Price, loadTxt[1].ListDishes[1].Price);
            Assert.AreEqual(lOrder[1].ListDishes[1].SidesDishes, loadTxt[1].ListDishes[1].SidesDishes);

            Assert.AreEqual(lOrder[1].ListDishes[2].Name, loadTxt[1].ListDishes[2].Name);
            Assert.AreEqual(lOrder[1].ListDishes[2].Price, loadTxt[1].ListDishes[2].Price);
            Assert.AreEqual(lOrder[1].ListDishes[2].SidesDishes, loadTxt[1].ListDishes[2].SidesDishes);


            order.ListDishes    = listOfDishes.LoadListSoups();
            date                = DateTime.Now.ToString();
            order.PriceAll.Date = date;
            lOrder.Add(order);
            save.SaveOrderList(TSave.ChoiceSaveOrder.Txt, lOrder);
            loadTxt = load.LoadOrderList(TLoadOrder.ChoiceLoadOrder.Txt);

            Assert.AreEqual(lOrder[2].PriceAll.Comments, loadTxt[2].PriceAll.Comments);
            Assert.AreEqual(lOrder[2].PriceAll.Date, loadTxt[2].PriceAll.Date);
            Assert.AreEqual(lOrder[2].PriceAll.Price, loadTxt[2].PriceAll.Price);

            Assert.AreEqual(lOrder[2].ListDishes[0].Name, loadTxt[2].ListDishes[0].Name);
            Assert.AreEqual("Pomidorowa", loadTxt[2].ListDishes[0].Name);
            Assert.AreEqual(lOrder[2].ListDishes[0].Price, loadTxt[2].ListDishes[0].Price);
            Assert.AreEqual(lOrder[2].ListDishes[0].SidesDishes, loadTxt[2].ListDishes[0].SidesDishes);

            Assert.AreEqual(lOrder[2].ListDishes[1].Name, loadTxt[2].ListDishes[1].Name);
            Assert.AreEqual(lOrder[2].ListDishes[1].Price, loadTxt[2].ListDishes[1].Price);
            Assert.AreEqual(lOrder[2].ListDishes[1].SidesDishes, loadTxt[2].ListDishes[1].SidesDishes);
        }
Exemple #6
0
        public void TestAddDishToListDisch()
        {
            Order        order   = new Order();
            ListOfDishes list    = new ListOfDishes();
            List <Dish>  lDishes = list.LoadListPizza();

            order.AddDishToListDisch(lDishes[0]);
            order.AddDishToListDisch(lDishes[1]);
            order.AddDishToListDisch(lDishes[2]);
            order.AddDishToListDisch(lDishes[3]);


            Assert.AreEqual("Margheritta", order.ListDishes[0].Name);
            Assert.AreEqual("20zł", order.ListDishes[0].Price);

            Assert.AreEqual("Vegetariana", order.ListDishes[1].Name);
            Assert.AreEqual("22zł", order.ListDishes[1].Price);

            Assert.AreEqual("Tosca", order.ListDishes[2].Name);
            Assert.AreEqual("25zł", order.ListDishes[2].Price);

            Assert.AreEqual("Venecia", order.ListDishes[3].Name);
            Assert.AreEqual("25zł", order.ListDishes[3].Price);

            lDishes = list.LoadListMainDish();
            order.AddDishToListDisch(lDishes[0]);
            order.AddDishToListDisch(lDishes[1]);
            order.AddDishToListDisch(lDishes[2]);

            Assert.AreEqual("Schabowy z frytkami/ryżem/ziemniakami", order.ListDishes[4].Name);
            Assert.AreEqual("30zł", order.ListDishes[4].Price);

            Assert.AreEqual("Ryba z frytkami", order.ListDishes[5].Name);
            Assert.AreEqual("28zł", order.ListDishes[5].Price);

            Assert.AreEqual("Placek po węgiersku", order.ListDishes[6].Name);
            Assert.AreEqual("27zł", order.ListDishes[6].Price);

            lDishes = list.LoadListSoups();
            order.AddDishToListDisch(lDishes[0]);
            order.AddDishToListDisch(lDishes[1]);

            Assert.AreEqual("Pomidorowa", order.ListDishes[7].Name);
            Assert.AreEqual("12zł", order.ListDishes[7].Price);

            Assert.AreEqual("Rosół", order.ListDishes[8].Name);
            Assert.AreEqual("10zł", order.ListDishes[8].Price);

            lDishes = list.LoadListDrinks();
            order.AddDishToListDisch(lDishes[0]);
            order.AddDishToListDisch(lDishes[1]);
            order.AddDishToListDisch(lDishes[2]);

            Assert.AreEqual("Kawa", order.ListDishes[9].Name);
            Assert.AreEqual("5zł", order.ListDishes[9].Price);

            Assert.AreEqual("Herbata", order.ListDishes[10].Name);
            Assert.AreEqual("5zł", order.ListDishes[10].Price);

            Assert.AreEqual("Cola", order.ListDishes[11].Name);
            Assert.AreEqual("5zł", order.ListDishes[11].Price);
        }