public void DataOfVariousLengthRoundTripCorrectly() { var encoder = new Base64UrlTextEncoder(); for (int length = 0; length != 256; ++length) { var data = new byte[length]; for (int index = 0; index != length; ++index) { data[index] = (byte)(5 + length + (index * 23)); } string text = encoder.Encode(data); byte[] result = encoder.Decode(text); for (int index = 0; index != length; ++index) { result[index].ShouldBe(data[index]); } } }
public UrlIdEncoder() { this.encoder = new Base64UrlTextEncoder(); }