public void ItDoesNotThrowAnExceptionIfTheEntityIsNotASecuredEntityWithTechnicalKey() { securedEntityValidatorForEntityThatIsNotSecured.ValidateAccess( "some object that doesnt extend SecuredEntityWithTechnicalKey", currentUser, typeof(string), string.Empty); }
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); }