Example #1
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" });
        }
        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" });
        }