コード例 #1
0
            private static async Task <StepResult> ExerciseEncryption(MessagingContext message)
            {
                var sut = new EncryptAS4MessageStep(CreateStubCertificateRepository().Object);

                // Act
                return(await sut.ExecuteAsync(message));
            }
コード例 #2
0
            public async Task ThenExecuteStepFailsWithInvalidCertificateAsync()
            {
                // Arrange
                Mock <ICertificateRepository> certificateRepositoryMock = CreateFailedMockedCertificateRepository();

                _step = new EncryptAS4MessageStep(certificateRepositoryMock.Object);

                // Act / Assert
                await Assert.ThrowsAnyAsync <Exception>(
                    () => _step.ExecuteAsync(CreateEncryptedAS4Message()));
            }