Exemplo n.º 1
0
        public async void TodoLifecycle()
        {
            var httpClient = this.factory_.CreateClient();
            var client     = new ResourceClient <Client.Todo>(ClientFactory.CreateTodoClient(httpClient));

            await ResourceLifecycleIntegrationTest.TestResource(
                client,
                createFactory : () => new Client.Todo
            {
                Title = "Test todo!"
            },
                updateFactory : (Client.Todo todo) =>
            {
                todo.Title = "Updated title!";
                return(todo);
            },
                options : (o) => o.Excluding(t => t.Id),
                authenticator : new TodoAuthenticator(ClientFactory.CreateUserClient(httpClient)));
        }
Exemplo n.º 2
0
        public async void UserLifecycle()
        {
            var httpClient = this.factory_.CreateClient();
            var client     = new UserResourceClient(ClientFactory.CreateUserClient(httpClient));

            await ResourceLifecycleIntegrationTest.TestResource(
                client,
                createFactory : () => new Client.User
            {
                Email    = "*****@*****.**",
                Password = "******"
            },
                updateFactory : (Client.User user) =>
            {
                user.Password = "******";
                return(user);
            },
                options : (o) => o.Excluding(u => u.Id).Excluding(u => u.Password),
                authenticator : null);

            ;
        }