Example #1
0
        public void CreateTenant_ShouldWork()
        {
            IntegTestUtils.WithDb(db => {
                db.Add(new Server
                {
                    Hostname = "localhost",
                    Id       = "localhost",
                    Login    = "******",
                    Password = "******"
                });
                db.Add(new Tenant
                {
                    ConfigDb = "Alcuin1_ADM",
                    PublicDb = "Alcuin1",
                    Id       = "Alcuin1",
                    ServerId = "localhost"
                });
                db.SaveChanges();

                var tenant = db.Find <Tenant>("Alcuin1");

                Assert.Equal("Alcuin1", tenant.Id);
                Assert.Equal("Alcuin1_ADM", tenant.ConfigDb);
                Assert.Equal("Alcuin1", tenant.PublicDb);
                Assert.Equal("localhost", tenant.ServerId);
            });
        }
Example #2
0
        public void CreateServer_ShouldWork()
        {
            IntegTestUtils.WithDb(db =>
            {
                db.Add(new Server
                {
                    Hostname = "localhost",
                    Id       = "localhost",
                    Login    = "******",
                    Password = "******"
                });
                db.SaveChanges();

                var server = db.Find <Server>("localhost");

                Assert.Equal("admin", server.Login);
                Assert.Equal("localhost", server.Hostname);
                Assert.Equal("localhost", server.Id);
                Assert.Equal("123", server.Password);
            });
        }