public async Task Handle_SaveExistingWithoutResponse_UpdatesUser()
        {
            var existing = new User {
                Name = "TestUser"
            };

            Context.Add(existing);

            await Context.SaveChangesAsync();

            var request = new SaveUserWithoutResponseRequest
            {
                Id   = existing.Id,
                User = new UserDto {
                    Name = "NewUser"
                }
            };

            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.AreEqual(1, Context.Set <User>().Count());

            var user = Context.Set <User>().FirstOrDefault();

            Assert.IsNotNull(user);
            Assert.AreEqual("NewUser", user.Name);
        }
        public async Task Handle_SaveWithoutResponse_CreatesUser()
        {
            var request = new SaveUserWithoutResponseRequest
            {
                User = new UserDto {
                    Name = "TestUser"
                }
            };

            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.AreEqual(1, Context.Set <User>().Count());

            var user = Context.Set <User>().FirstOrDefault();

            Assert.IsNotNull(user);
            Assert.AreEqual("TestUser", user.Name);
        }