Esempio n. 1
0
        /// <summary>
        /// Assert the service has been initialized correctly.
        /// </summary>
        /// <param name="service">the HermesAuthorizationService instance to check</param>
        private void AssertInitializedFields(HermesAuthorizationService service)
        {
            IDictionary <KeyValuePair <string, string>, Boolean> logins =
                (IDictionary <KeyValuePair <string, string>, Boolean>)GetField(service, "_Logins");

            CompareDictionies(ConstructExpectedLogins(), logins, "_Logins");

            IDictionary <string, Boolean> roles =
                (IDictionary <string, Boolean>)GetField(service, "_Roles");

            CompareDictionies(ConstructExpectedRoles(), roles, "_Roles");

            IDictionary <string, Boolean> functions =
                (IDictionary <string, Boolean>)GetField(service, "_Functions");

            CompareDictionies(ConstructExpectedFunctions(), functions, "_Functions");

            IDictionary <string, List <KeyValuePair <string, string> > > functionsAttributes =
                (IDictionary <string, List <KeyValuePair <string, string> > >)GetField(service, "_FunctionsAttributes");

            CompareDictionies2(ConstructExpectedFunctionsAtributes(), functionsAttributes, "_FunctionsAttributes");

            IDictionary <string, Rights> entities =
                (IDictionary <string, Rights>)GetField(service, "_Entities");

            CompareDictionies(ConstructExpectedEntities(), entities, "_Entities");
        }
Esempio n. 2
0
        protected void SetUp()
        {
            LoadConfig();

            service =
                new HermesAuthorizationService(
                    "Hermes.Services.Security.Authorization.TopCoder.HermesAuthorizationService");
        }
Esempio n. 3
0
        public void TestConstructor_Accuracy2()
        {
            service =
                new HermesAuthorizationService(
                    "Hermes.Services.Security.Authorization.TopCoder.HermesAuthorizationService");

            AssertInitializedFields(service);
        }
Esempio n. 4
0
        public void TestConstructor_Accuracy1()
        {
            service = new HermesAuthorizationService();

            AssertInitializedFields(service);
        }