Ejemplo n.º 1
0
        public void Task_Can_Delete_Where_Is_Archived_Property_Is_True()
        {
            var task = BusinessHelper.CreateTaskThatIsArchivedAndLogon(
                TaskTests.UserName,
                TaskTests.UserPassword);

            Exception exception = null;

            try
            {
                TaskService.TaskDelete(task);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, "Exception should be null");
        }
        public void Task_Cannot_Delete_Where_Is_Archived_Property_Is_True()
        {
            var task = BusinessHelper.CreateTaskThatIsArchivedAndLogon(
                TaskTestsWithRoleContribute.UserName,
                TaskTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                TaskService.TaskDelete(task);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException, "Exception should be of type SecurityException");
        }
Ejemplo n.º 3
0
        public void Task_Can_Edit_Where_Is_Archived_Property_Is_True()
        {
            var task = BusinessHelper.CreateTaskThatIsArchivedAndLogon(
                TaskTests.UserName,
                TaskTests.UserPassword);

            Exception exception = null;

            try
            {
                task = TaskService.TaskFetch(task.TaskId);

                task.Description = DataHelper.RandomString(100);

                TaskService.TaskSave(task);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, string.Format("Exception should be null, but is: {0}", exception));
        }
        public void Task_Cannot_Edit_Where_Is_Archived_Property_Is_True()
        {
            var task = BusinessHelper.CreateTaskThatIsArchivedAndLogon(
                TaskTestsWithRoleContribute.UserName,
                TaskTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                task = TaskService.TaskFetch(task.TaskId);

                task.Description = DataHelper.RandomString(100);

                TaskService.TaskSave(task);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException, "Exception should be of type SecurityException");
        }