예제 #1
0
        public void AddAdministrator()
        {
            var apiRepository = new ApiMongoRepository(CONNECTION_STRING);
            var repository    = new MongoRepository(CONNECTION_STRING,
                                                    apiRepository);
            var userName = "******";
            var secret   = "test";
            var manager  = repository.CreateManager(userName, secret);
            var admin    = repository.CreateManager(userName + "2", secret);

            var domain = repository.CreateDomain("test", manager);

            admin = repository.AddAdministrator(domain.Id, userName + "2");

            Assert.AreEqual(userName + "2", admin.UserName);

            repository.DeleteManager(manager.Id, secret);
            repository.DeleteManager(admin.Id, secret);
        }