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
        public void TestUpdate()
        {
            try
            {
                Saved_Task.GetUpdate("updatedTask1", "updateedDes", null).Invoke(1);

                iTask task2 = Task.GetTaskByID(Saved_Task.getID());
                Assert.AreEqual(task2.getTitle(), "updatedTask1");
            }
            catch (MileStone4.AlmogException ex)
            {
                Assert.Fail((String)ex.Value, new object[] { ex });
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message, new object[] { e });
            }
        }