Example #1
0
 public virtual void start(AuthorizationScenario scenario, string userId, IDictionary <string, string> resourceBindings)
 {
     Assert.assertNull(interceptor.LastException);
     scenarioInstance = new AuthorizationScenarioInstance(scenario, engineRule.AuthorizationService, resourceBindings);
     enableAuthorization(userId);
     interceptor.activate();
 }
Example #2
0
        /// <summary>
        /// Assert the scenario conditions. If no exception or the expected one was thrown.
        /// </summary>
        /// <param name="scenario"> the scenario to assert on </param>
        /// <returns> true if no exception was thrown, false otherwise </returns>
        public virtual bool assertScenario(AuthorizationScenario scenario)
        {
            interceptor.deactivate();
            disableAuthorization();
            scenarioInstance.tearDown(engineRule.AuthorizationService);
            scenarioInstance.assertAuthorizationException(interceptor.LastException);
            scenarioInstance = null;

            return(scenarioSucceeded());
        }