Example #1
0
            public void ShouldThrowExceptionWhenSignatureIsNull()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                ExceptionAssert.ThrowsArgumentNullException("signature", () =>
                {
                    validator.Validate(new byte[] { 0 }, null);
                });
            }
Example #2
0
            public void ShouldThrowExceptionWhenContentIsEmpty()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                ExceptionAssert.ThrowsArgumentEmptyException("content", () =>
                {
                    validator.Validate(new byte[] { }, "test");
                });
            }
Example #3
0
            public void ShouldThrowExceptionWhenContentIsNull()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                ExceptionAssert.ThrowsArgumentNullException("content", () =>
                {
                    validator.Validate(null, "test");
                });
            }
Example #4
0
            public void ShouldThrowExceptionWhenSignatureIsInvalid()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                ExceptionAssert.Throws <LineBotException>("Invalid signature.", () =>
                {
                    validator.Validate(new byte[] { 42 }, "============================================");
                });
            }
Example #5
0
            public void ShouldThrowExceptionWhenSignatureIsEmpty()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                ExceptionAssert.ThrowsArgumentEmptyException("signature", () =>
                {
                    validator.Validate(new byte[] { 0 }, string.Empty);
                });
            }
Example #6
0
            public void ShouldNotThrowExceptionWhenSignatureIsValid()
            {
                SignatureValidator validator = new SignatureValidator(TestConfiguration.Create());

                validator.Validate(new byte[] { 42 }, "aajPtaEL8oyiitLlTbSzkFCTDQ7Lr0m/89eDhe6tFx4=");
            }