public async void AdminCreatesRole(string role)
        {
            var statement = new CreateRoleStatement(role);
            var result    = await statement.ExecuteAsync(adminContext);

            Assert.NotNull(result);
            Assert.True(result.IsEmpty());
            Assert.Equal(role, createdRole);
        }
Пример #2
0
        protected override SqlStatement VisitCreateRole(CreateRoleStatement statement)
        {
            builder.AppendFormat("CREATE ROLE {0}", statement.RoleName);

            return(base.VisitCreateRole(statement));
        }
Пример #3
0
 protected virtual SqlStatement VisitCreateRole(CreateRoleStatement statement)
 {
     return new CreateRoleStatement(statement.RoleName);
 }
Пример #4
0
        protected override SqlStatement VisitCreateRole(CreateRoleStatement statement)
        {
            builder.AppendFormat("CREATE ROLE {0}", statement.RoleName);

            return base.VisitCreateRole(statement);
        }
Пример #5
0
 protected virtual SqlStatement VisitCreateRole(CreateRoleStatement statement)
 {
     return(new CreateRoleStatement(statement.RoleName));
 }
        public async void UserCreatesRole(string role)
        {
            var statement = new CreateRoleStatement(role);

            await Assert.ThrowsAsync <UnauthorizedAccessException>(() => statement.ExecuteAsync(userContext));
        }
        public void CreateRole_AsString(string role, string expected)
        {
            var statement = new CreateRoleStatement(role);

            Assert.Equal(expected, statement.ToSqlString());
        }