Ejemplo n.º 1
0
        public async Task Can_create_and_delete_user()
        {
            using (IActorDbClient client = await ActorDbClient.BeginSession("root", "rootpass"))
            {
                var acl = new KeyValuePair <string, ActorPermissions>("*", ActorPermissions.Read | ActorPermissions.Write);

                var username = $"{Guid.NewGuid()}";

                var create = await client.CreateUserAsync(username, "mypass2", acl);

                Assert.Equal(CreateUserResult.Success, create);

                var exists = await client.CreateUserAsync(username, "mypass2", acl);

                Assert.Equal(CreateUserResult.Exists, exists);

                var delete = await client.DeleteUserAsync(username);

                Assert.Equal(DeleteUserResult.Success, delete);

                var gone = await client.DeleteUserAsync(username);

                Assert.Equal(DeleteUserResult.DoesNotExist, gone);
            }
        }
Ejemplo n.º 2
0
        public async Task Can_get_unique_id()
        {
            using (IActorDbClient client = await ActorDbClient.BeginSession("myuser", "mypass"))
            {
                var id = await client.GetUniqueIdAsync();

                _output.WriteLine($"{id}");
                Assert.NotNull(id);
            }
        }
Ejemplo n.º 3
0
        public async Task Can_get_configuration()
        {
            using (IActorDbClient client = await ActorDbClient.BeginSession("root", "rootpass"))
            {
                var config = await client.GetConfigurationAsync();

                Assert.NotNull(config);

                _output.WriteLine(JsonConvert.SerializeObject(config));
            }
        }
Ejemplo n.º 4
0
        public async Task Can_get_actor_types()
        {
            using (IActorDbClient client = await ActorDbClient.BeginSession("myuser", "mypass"))
            {
                var types = await client.GetActorTypesAsync();

                foreach (var type in types)
                {
                    _output.WriteLine(type);
                }
                Assert.NotNull(types);
            }
        }