Exemplo n.º 1
0
        public void WhenCalledWithInvalidCertificate_ThenThrowsNotFoundException(UpdateCertificateWithReprintReasonCommand command)
        {
            // Arrange
            var fixture = new UpdateCertificateWithReprintReasonCommandHandlerTestsFixture()
                          .WithCertificate(command.CertificateReference);

            command.OtherReason = string.Empty;

            // Act & Assert
            Assert.ThrowsAsync <NotFoundException>(async() => await
                                                   fixture.Handle(new UpdateCertificateWithReprintReasonCommand
            {
                CertificateReference = command.CertificateReference + "NotValid",
                IncidentNumber       = command.IncidentNumber,
                Reasons     = command.Reasons,
                OtherReason = command.OtherReason,
                Username    = command.Username
            }));
        }
Exemplo n.º 2
0
        public async Task WhenCalled_ThenGetCertificateIsCalled_ForCertificateReference(UpdateCertificateWithReprintReasonCommand command)
        {
            // Arrange
            var fixture = new UpdateCertificateWithReprintReasonCommandHandlerTestsFixture()
                          .WithCertificate(command.CertificateReference);

            // Act
            await fixture.Handle(new UpdateCertificateWithReprintReasonCommand
            {
                CertificateReference = command.CertificateReference,
                IncidentNumber       = command.IncidentNumber,
                Reasons     = command.Reasons,
                OtherReason = command.OtherReason,
                Username    = command.Username
            });

            // Assert
            fixture.VerifyGetCertificateCalled(command.CertificateReference);
        }