Esempio n. 1
0
        public void Setup()
        {
            var webLoader     = new WebLoader();
            var settings      = new SettingsStub();
            var repos         = new SecurityRepository(webLoader, settings);
            var useraccessDto = repos.LoadAccessLevel().Result;

            _permissionManager = new PermissionManager(useraccessDto);
        }
Esempio n. 2
0
        public void CanLoadSessionMap()
        {
            var webLoader = new WebLoader();
            var settings  = new SettingsStub();
            var repos     = new SecurityRepository(webLoader, settings);

            var level = repos.LoadSessionMap().Result;

            Assert.IsNotNull(level);
            level.AssertNoPropertiesAreNull();
        }
Esempio n. 3
0
        private void CanLoadAccessLevelFromPath(string rulesPath, string sessionMapPath)
        {
            var fileLoader = new FileLoader();
            var settings   = new SettingsStub()
                             .WithRulesPath(Path.Combine(Directory.GetCurrentDirectory(), rulesPath))
                             .WithSessionMapPath(Path.Combine(Directory.GetCurrentDirectory(), sessionMapPath));
            var repos = new SecurityRepository(fileLoader, settings);

            RulesDto level = repos.LoadAccessLevel().Result;

            Assert.IsNotNull(level);
            level.AssertNoPropertiesAreNull(new [] { "Identifier" });
        }
Esempio n. 4
0
        public void Setup()
        {
//            var webLoader = new WebLoader();
//            var settings = new SettingsStub();
//            var repos = new SecurityRepository(webLoader, settings);
            var fileLoader = new FileLoader();
            var settings   = new SettingsStub()
                             .WithRulesPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../../resource/test/ignite_rules.json"))
                             .WithSessionMapPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../../resource/test/ignite_session_map.json"));
            var repos = new SecurityRepository(fileLoader, settings);

            var useraccessDto = repos.LoadAccessLevel().Result;

            _permissionManager = new PermissionManager(useraccessDto);
        }
        public void CanLoadAccessLevel()
        {
//            var webLoader = new WebLoader();
//            var settings = new SettingsStub();
//            var repos = new SecurityRepository(webLoader, settings);

            var fileLoader = new FileLoader();
            var settings   = new SettingsStub()
                             .WithRulesPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../../resource/test/ignite_rules.json"))
                             .WithSessionMapPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../../resource/test/ignite_session_map.json"));
            var repos = new SecurityRepository(fileLoader, settings);

            RulesDto level = repos.LoadAccessLevel().Result;

            Assert.IsNotNull(level);
            level.AssertNoPropertiesAreNull(new [] { "Identifier" });
        }