Example #1
0
        public static void ClassInit(TestContext context)
        {
            var solutionDir = Path.GetDirectoryName(Path.GetDirectoryName(context.TestDir));
            var tempDir     = Path.Combine(solutionDir, "crema_repo", "permission_test", "type_guest");
            var empty       = DirectoryUtility.Exists(tempDir) == false || DirectoryUtility.IsEmpty(tempDir);

            cremaHost = TestCrema.GetInstance(tempDir);
            cremaHost.Open();

            if (empty == true)
            {
                CremaSimpleGenerator.Generate(cremaHost, 10);
            }

            cremaHost.Dispatcher.Invoke(() =>
            {
                var userContext = cremaHost.GetService <IUserContext>();

                foreach (var item in userContext.Users)
                {
                    var authentication = cremaHost.Login(item.ID, item.Authority.ToString().ToLower());
                    users.Add(item, authentication);
                }
            });
        }
Example #2
0
        public static void ClassInit(TestContext context)
        {
            var solutionDir = Path.GetDirectoryName(Path.GetDirectoryName(context.TestDir));
            var path        = Path.Combine(solutionDir, "crema_repo", "test_all");

            cremaHost = TestCrema.GetInstance(path);
        }
Example #3
0
        public static void ClassInit(TestContext context)
        {
            var solutionDir = Path.GetDirectoryName(Path.GetDirectoryName(context.TestDir));
            var tempDir     = Path.Combine(solutionDir, "crema_repo", "permission_test", typeof(PermissionTest).Name);
            var empty       = DirectoryUtility.Exists(tempDir) == false || DirectoryUtility.IsEmpty(tempDir);

            cremaHost = TestCrema.GetInstance(tempDir);
            cremaHost.Open();

            if (empty == true)
            {
                CremaSimpleGenerator.Generate(cremaHost, 10);
            }

            users.Initialize(cremaHost);
        }
Example #4
0
 public void Initialize()
 {
     cremaHost = TestCrema.CreateInstance(tempDir);
     cremaHost.Open();
 }