Exemplo n.º 1
0
        public async Task Handle_InvalidUpdateUserByIdRequest_ReturnsNull()
        {
            var request = new UpdateUserByIdRequest {
                Id = 100, Name = string.Empty
            };
            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.IsNull(response.Result);
        }
Exemplo n.º 2
0
        public async Task Handle_UpdateUserByIdRequest_UpdatesUser()
        {
            var request = new UpdateUserByIdRequest
            {
                Id   = _user.Id,
                Name = "NewName"
            };

            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.IsNotNull(response.Result);
            Assert.AreEqual(_user.Id, response.Result.Id);
            Assert.AreEqual("NewName", response.Result.Name);
        }