コード例 #1
0
        public async void CreateWithInvalidName(string user, string password)
        {
            var statement = new CreateUserStatement(user, new PasswordIdentificationInfo(password));
            var result    = await statement.ExecuteAsync(adminContext);

            Assert.NotNull(result);
            Assert.True(result.IsError());
            Assert.IsType <SqlStatementException>(result.Error());
        }
コード例 #2
0
        public async void AdminCreatesUserWithPassword(string user, string password)
        {
            var statement = new CreateUserStatement(user, new PasswordIdentificationInfo(password));
            var result    = await statement.ExecuteAsync(adminContext);

            Assert.NotNull(result);
            Assert.True(result.IsEmpty());
            Assert.Equal(user, createdUser);
        }
コード例 #3
0
        public async void UserCreatesOtherUser(string user, string password)
        {
            var statement = new CreateUserStatement(user, new PasswordIdentificationInfo(password));

            await Assert.ThrowsAsync <UnauthorizedAccessException>(() => statement.ExecuteAsync(userContext));
        }