public void EnsureUserIsAddedToWindowsSettings() { using (var documentStore = new EmbeddableDocumentStore { RunInMemory = true, }) { documentStore.Initialize(); RavenUserInstaller.AddUserToDatabase(@"domain\user", documentStore); var systemCommands = documentStore .DatabaseCommands .ForSystemDatabase(); var existing = systemCommands.Get("Raven/Authorization/WindowsSettings"); var expected = @"{ ""RequiredGroups"": [], ""RequiredUsers"": [ { ""Name"": ""domain\\user"", ""Enabled"": true, ""Databases"": [ { ""Admin"": true, ""ReadOnly"": false, ""TenantId"": ""<system>"" } ] } ] }".Replace("\r", String.Empty); var actual = existing.DataAsJson.ToString().Replace("\r", String.Empty); Assert.AreEqual(expected, actual); } }
public void Integration() { using (var documentStore = new DocumentStore { Url = "http://*****:*****@"\Test"; RavenUserInstaller.AddUserToDatabase(identity, documentStore); } }