public virtual void TestDecode() { JGitTestUtil.AssertEquals(B("hi\n"), Base64.DecodeBytes("aGkK")); JGitTestUtil.AssertEquals(B("\x0\x1\x2\r\n\tq"), Base64.DecodeBytes("AAECDQoJcQ==")); JGitTestUtil.AssertEquals(B("\x0\x1\x2\r\n\tq"), Base64.DecodeBytes("A A E\tC D\rQ o\nJ c Q==" )); JGitTestUtil.AssertEquals(B("\u000EB"), Base64.DecodeBytes("DkL=")); }
public virtual void TestEncodeMatchesDecode() { string[] testStrings = new string[] { string.Empty, "cow", "a", "a secret string" , "\x0\x1\x2\r\n\t" }; // // // // // foreach (string e in testStrings) { JGitTestUtil.AssertEquals(B(e), Base64.DecodeBytes(Base64.EncodeBytes(B(e)))); } }