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