public void Should_be_able_to_create_permissions_in_default_Vhost()
        {
            var user = managementClient.GetUsers().SingleOrDefault(x => x.Name == testUser);
            if (user == null)
            {
                //create user if it does not exists
                var userInfo = new UserInfo(testUser, "topSecret").AddTag("administrator");
                user = managementClient.CreateUser(userInfo);
            }
            var vhost = managementClient.GetVHosts().SingleOrDefault(x => x.Name == vhostName);
            if (vhost == null)
            {
                throw new ApplicationException(string.Format("Default vhost: '{0}' has not been created", testVHost));

            }

            var permissionInfo = new PermissionInfo(user, vhost);
            managementClient.CreatePermission(permissionInfo);
        }
Exemplo n.º 2
0
        public void Should_be_able_to_create_permissions()
        {
            var user = managementClient.GetUsers().SingleOrDefault(x => x.Name == testUser);
            if (user == null)
            {
                throw new ApplicationException(string.Format("user '{0}' hasn't been created", testUser));
            }
            var vhost = managementClient.GetVHosts().SingleOrDefault(x => x.Name == testVHost);
            if (vhost == null)
            {
                throw new ApplicationException(string.Format("Test vhost: '{0}' has not been created", testVHost));
            }

            var permissionInfo = new PermissionInfo(user, vhost);
            managementClient.CreatePermission(permissionInfo);
        }
Exemplo n.º 3
0
 public void SetUp()
 {
     user = new User { Name = "mikey" };
     vhost = new Vhost { Name = "theVHostName" };
     permissionInfo = new PermissionInfo(user, vhost);
 }