Exemplo n.º 1
0
        public void TestSave()
        {
            try
            {
                // task1 = new Task("testCre", "task1", new DateTime(2019, 12, 12));
                int id = InterfaceLayer.CreateNewTask("testCre", "task1", new DateTime(2019, 12, 12));


                Saved_Task = Task.GetTaskByID(id);
                Assert.AreEqual(Saved_Task.getDescription(), "task1");

                List <int> list = TaskDAL.GetTaskByColumn(1);
                if (!list.Contains(Saved_Task.getID()))
                {
                    Assert.Fail("didn't save the task to the correct column");
                }
            }
            catch (MileStone4.AlmogException ex)
            {
                Assert.Fail((String)ex.Value, new object[] { ex });
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message, new object[] { e });
            }
        }
Exemplo n.º 2
0
 private void Create_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         // InterfaceLayer.createTask(taskC.title, taskC.des, taskC.due, InterfaceLayer.getBoard());
         InterfaceLayer.CreateNewTask(taskC.title, taskC.des, taskC.due);
         errors.error = "";
         refresh();
     }
     catch (AlmogException exi)
     {
         errors.error = (String)exi.Value;
     }
 }
Exemplo n.º 3
0
        public void TestBadCreation()
        {
            try
            {
                // note - createnewTask also saves the task. the error would accore when trying to save
                InterfaceLayer.CreateNewTask("testCre", "task1", new DateTime(2018, 12, 12));

                Assert.Fail("saved although bad");
            }
            catch (MileStone4.AlmogException ex)
            {
                //good
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message, new object[] { e });
            }
        }