Ejemplo n.º 1
0
        public void Hour_Fetch()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleReview.UserName,
                HourTestsWithRoleReview.UserPassword);

            Exception exception = null;

            try
            {
                HourService.HourFetch(hour.HourId);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, "Exception should be null");
        }
Ejemplo n.º 2
0
        public void Hour_Delete()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleReview.UserName,
                HourTestsWithRoleReview.UserPassword);

            Exception exception = null;

            try
            {
                HourService.HourDelete(hour.HourId);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException);
        }
Ejemplo n.º 3
0
        public void Hour_Cannot_Delete_Record_For_Different_User()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                HourService.HourDelete(hour.HourId);
            }
            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.º 4
0
        public void Hour_Fetch_List()
        {
            BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

            try
            {
                HourService.HourFetchInfoList();
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception == null, "Exception should be null");
        }
Ejemplo n.º 5
0
        public void Hour_Edit()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleReview.UserName,
                HourTestsWithRoleReview.UserPassword);

            Exception exception = null;

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

                hour.Notes = DataHelper.RandomString(20);

                hour = HourService.HourSave(hour);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsTrue(exception != null, "Exception should not be null");
            Assert.IsTrue(exception.GetBaseException() is SecurityException);
        }
Ejemplo n.º 6
0
        public void Hour_Cannot_Write_To_User_Id_Property()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

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

                hour.UserId = DataHelper.RandomNumber(1000);

                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");
        }
Ejemplo n.º 7
0
        public void Hour_Cannot_Edit_Record_For_Different_User()
        {
            var hour = BusinessHelper.CreateHourAndLogon(
                HourTestsWithRoleContribute.UserName,
                HourTestsWithRoleContribute.UserPassword);

            Exception exception = null;

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

                hour.Notes = DataHelper.RandomString(20);

                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");
        }