Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        public void Integration()
        {
            using (var documentStore = new DocumentStore
            {
                Url = "http://*****:*****@"\Test";
                RavenUserInstaller.AddUserToDatabase(identity, documentStore);
            }
        }