Пример #1
0
 public virtual void Start(AuthorizationScenario scenario, string userId, IDictionary <string, string> resourceBindings)
 {
     Assert.IsNull(Interceptor.LastException);
     ScenarioInstance = new AuthorizationScenarioInstance(scenario, EngineRule.IAuthorizationService, resourceBindings);
     EnableAuthorization(userId);
     Interceptor.Activate();
 }
Пример #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.IAuthorizationService);
            ScenarioInstance.AssertAuthorizationException(Interceptor.LastException);
            ScenarioInstance = null;

            return(ScenarioSucceeded());
        }