Ejemplo n.º 1
0
        public void Handle_ReturnFalse_WhenDataIsInvalid()
        {
            var command = new UpdateCommand
            {
                Id = 0,
            };

            var handler = new UpdateCommand.UpdateCommandHandler(_configConstants, _mapper, _unitOfWork);

            Should.ThrowAsync <NotFoundException>(async() => await handler.Handle(command, CancellationToken.None)).Result.Message.ShouldBe("The Tender ID 0 is not found");
        }
Ejemplo n.º 2
0
        public async Task Handle_ReturnTrue_WhenDataIsValid()
        {
            var command = new UpdateCommand
            {
                Id             = 100,
                Name           = "Tender Name",
                ContractNumber = "Contract Number",
            };

            var handler = new UpdateCommand.UpdateCommandHandler(_configConstants, _mapper, _unitOfWork);
            var result  = await handler.Handle(command, CancellationToken.None);

            result.ShouldBe(true);
        }