public void GetStringTest(BaseNEncoding encoding, byte[] plainTextData, string encodedData) { var actual = encoding.GetString(plainTextData); var charCount = encoding.GetCharCount(plainTextData); Assert.Equal(encodedData, actual); Assert.Equal(charCount, actual.Length); }
public void GetStringPartTest(BaseNEncoding encoding, byte[] plainTextData, string encodedData) { var random = new Random(9375220); var input = PadData(plainTextData, out var offset, out _, random); var actual = encoding.GetString(input, offset, plainTextData.Length); var charCount = encoding.GetCharCount(input, offset, plainTextData.Length); Assert.Equal(encodedData, actual); Assert.Equal(charCount, actual.Length); }