Пример #1
0
 public void ItDoesNotThrowAnExceptionIfTheEntityIsNotASecuredEntityWithTechnicalKey()
 {
     securedEntityValidatorForEntityThatIsNotSecured.ValidateAccess(
         "some object that doesnt extend SecuredEntityWithTechnicalKey",
         currentUser,
         typeof(string),
         string.Empty);
 }
Пример #2
0
        public void ItThrowsAnUnauthorizedAccessExceptionIfTheGamingGroupIdsDoNotMatch()
        {
            currentUser.CurrentGamingGroupId = 999999;
            Type stringType = typeof(string);
            UnauthorizedEntityAccessException expectedException = new UnauthorizedEntityAccessException(currentUser.Id,
                                                                                                        stringType,
                                                                                                        string.Empty);

            UnauthorizedEntityAccessException exception = Assert.Throws <UnauthorizedEntityAccessException>(
                () => securedEntityValidatorForSecuredEntity.ValidateAccess(securedEntity, currentUser, stringType, string.Empty));

            Assert.AreEqual(expectedException.Message, exception.Message);
        }