Exemple #1
0
        public void when_IsPostbackChecksumValid_is_called_with_invalid_postback_in_body_then_false_is_returned()
        {
            // Arrange
            IDictionary <string, string[]> headers = new Dictionary <string, string[]> {
                { "Content-Type", new[] { "application/json" } }
            };
            string body = RequestBodies.MockPostbackInvalid;

            // Act
            SignhostApiReceiver signhostApiReceiver = new SignhostApiReceiver(receiverSettings);
            bool result = signhostApiReceiver.IsPostbackChecksumValid(headers, body, out Transaction transaction);

            // Assert
            result.Should().BeFalse();
        }
Exemple #2
0
        public void when_IsPostbackChecksumValid_is_called_with_valid_postback_in_header_then_true_is_returned()
        {
            // Arrange
            IDictionary <string, string[]> headers = new Dictionary <string, string[]> {
                { "Content-Type", new[] { "application/json" } },
                { "Checksum", new[] { "cdc09eee2ed6df2846dcc193aedfef59f2834f8d" } }
            };
            string body = RequestBodies.MockPostbackValid;

            // Act
            SignhostApiReceiver signhostApiReceiver = new SignhostApiReceiver(receiverSettings);
            bool result = signhostApiReceiver.IsPostbackChecksumValid(headers, body, out Transaction transaction);

            // Assert
            result.Should().BeTrue();
        }