public async Task Create_WithValidModel_CreatesUser()
        {
            using WebApplicationFactory factory = new();
            TestableUsersClient usersClient = factory.Client;

            HttpClient client = factory.CreateClient();

            var values = new Dictionary <string?, string?>
            {
                { nameof(UserViewModel.Id), "42" },
                { nameof(UserViewModel.FirstName), "John" },
                { nameof(UserViewModel.LastName), "Smith" },
            };

            using FormUrlEncodedContent content = new(values);

            HttpResponseMessage response = await client.PostAsync("/users/create", content);

            response.EnsureSuccessStatusCode();
            Web.Api.User?createdUser = await usersClient.GetAsync(42);

            Assert.AreEqual(42, createdUser.Id);
            Assert.AreEqual("John", createdUser.FirstName);
            Assert.AreEqual("Smith", createdUser.LastName);
            Assert.AreEqual(1, usersClient.PostInvocationCount);
        }
        public async Task Delete_WithUserId_RemovesUsers()
        {
            using WebApplicationFactory factory = new();
            TestableUsersClient usersClient = factory.Client;
            await usersClient.PostAsync(new Web.Api.User
            {
                Id        = 42,
                FirstName = "John",
                LastName  = "Smith"
            });

            HttpClient client = factory.CreateClient();

            var values = new Dictionary <string?, string?>
            {
                { nameof(UserViewModel.Id), "42" }
            };

            using FormUrlEncodedContent content = new(values);
            HttpResponseMessage response = await client.PostAsync("/users/delete", content);

            response.EnsureSuccessStatusCode();
            Assert.AreEqual(1, usersClient.DeleteInvocationCount);
            Assert.IsNull(await usersClient.GetAsync(42));
        }