Exemple #1
0
        public void Handle_GivenValidRequest_ShouldUpdateApplicant()
        {
            // Arrange
            var sut = new UpdateApplicantCommandQueryHandler(_context);

            // Act
            var result = sut.Handle(new UpdateApplicantCommand {
                ID = 1
            }, CancellationToken.None);


            // Assert
            result.Result.Equals(Unit.Value);
        }
Exemple #2
0
        public async Task Handle_GivenInValidRequestId_ShouldThrowNotFoundException()
        {
            // Arrange
            var sut     = new UpdateApplicantCommandQueryHandler(_context);
            var id      = 100;
            var request = new UpdateApplicantCommand {
                ID = id
            };

            // Act


            // Assert
            await Assert.ThrowsAsync <NotFoundException>(() => sut.Handle(request, CancellationToken.None));
        }