Ejemplo n.º 1
0
        public void Hour_Cannot_Delete_Where_Is_Archived_Property_Is_True()
        {
            var hour = BusinessHelper.CreateHourThatIsArchivedAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                HourService.HourDelete(hour);
            }
            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.º 2
0
        public void Hour_Cannot_Edit_Where_Is_Archived_Property_Is_True()
        {
            var hour = BusinessHelper.CreateHourThatIsArchivedAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                hour = HourService.HourFetch(hour.HourId);

                hour.Notes = DataHelper.RandomString(100);

                HourService.HourSave(hour);
            }
            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");
        }