public void TestSignWithKey() { var g = new Gateway("1", "incorrectPassword"); var testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "two" } }; Assert.True(g.Sign(testSample, "pass").StartsWith("86cdc")); }
public void TestSigning() { var testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "two" } }; Assert.True(gateway.Sign(testSample).StartsWith("86cdc")); testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "New lines! %0D %0D%0A" } }; Assert.True(gateway.Sign(testSample).StartsWith("cf50d")); testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "strange \"'?& symbols " } }; Assert.True(gateway.Sign(testSample).StartsWith("7c952")); testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "a £ sign" } }; Assert.True(gateway.Sign(testSample).StartsWith("13637")); testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "aa ** stars" } }; Assert.True(gateway.Sign(testSample).StartsWith("47a2b1")); testSample = new Dictionary <string, string> { { "a", "one" }, { "b", "newline \n characater" } }; Assert.True(gateway.Sign(testSample).StartsWith("19582")); testSample = new Dictionary <string, string> { { "a[aa]", "12" }, { "a[bb]", "13" }, { "a1", "0" }, { "aa", "1" }, { "aZ", "2" } }; Assert.True(gateway.Sign(testSample).StartsWith("4aeaa")); }