コード例 #1
0
        public void WhenCalledWithInvalidCertificate_ThenThrowsNotFoundException(UpdateCertificateWithAmendReasonCommand command)
        {
            // Arrange
            var fixture = new UpdateCertificateWithAmendReasonCommandHandlerTestsFixture()
                          .WithCertificate(command.CertificateReference);

            command.OtherReason = string.Empty;

            // Act & Assert
            Assert.ThrowsAsync <NotFoundException>(async() => await
                                                   fixture.Handle(new UpdateCertificateWithAmendReasonCommand
            {
                CertificateReference = command.CertificateReference + "NotValid",
                IncidentNumber       = command.IncidentNumber,
                Reasons     = command.Reasons,
                OtherReason = command.OtherReason,
                Username    = command.Username
            }));
        }
コード例 #2
0
        public async Task WhenCalled_ThenGetCertificateIsCalled_ForCertificateReference(UpdateCertificateWithAmendReasonCommand command)
        {
            // Arrange
            var fixture = new UpdateCertificateWithAmendReasonCommandHandlerTestsFixture()
                          .WithCertificate(command.CertificateReference);

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

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