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); } }); }
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); }