Beispiel #1
0
        public void Generate_HMAC_For_Empty_DibsPost()
        {
            // Arrange
            var post = new DibsPost();

            // Act
            string mac = post.GenerateHMAC(KEY);

            // Assert
            string expected = HMACGenerator.HashHMACHex(KEY,
                                                        "acceptreturnurl=&amount=&callbackurl=&cancelreturnurl=&currency=&language=&merchant=&orderid=");

            Assert.AreEqual(expected, mac);
        }
        public void Genereate_HMAC_For_Test_DibsPost()
        {
            // Arrange
            var post = new DibsPost();

            post.Test = "1";
            // Act
            string mac = post.GenerateHMAC(KEY);

            // Assert
            string expected = HMACGenerator.HashHMACHex(KEY,
                                                        "acceptreturnurl=&amount=&billingaddress=&billingemail=&billingfirstname=&billinglastname=&billingmobile=&billingpostalcode=&billingpostalplace=&callbackurl=&cancelreturnurl=&currency=&language=&merchant=&orderId=&paytype=&test=1");

            Assert.AreEqual(expected, mac);
        }