Пример #1
0
        public void GetChars_ExtendedChar_ReturnsTruncated()
        {
            ASCIISevenBitTruncatingEncoding encoding = new ASCIISevenBitTruncatingEncoding();

            char[] chars = encoding.GetChars(new[] { (byte)250 }, 0, 1);

            Assert.Equal(new[] { 'z' }, chars);
        }
Пример #2
0
        public void GetChars_ASCIIChar_ReturnsOriginal()
        {
            ASCIISevenBitTruncatingEncoding encoding = new ASCIISevenBitTruncatingEncoding();

            char[] chars = encoding.GetChars(new[] { (byte)'a', (byte)'b', (byte)'c' }, 0, 3);

            Assert.Equal(new[] { 'a', 'b', 'c' }, chars);
        }