Fallback() публичный Метод

public Fallback ( char charUnknownHigh, char charUnknownLow, int index ) : bool
charUnknownHigh char
charUnknownLow char
index int
Результат bool
Пример #1
0
        public void FallbackRecursiveError()
        {
            Buffer b = NewInstance();

            b.Fallback('X', 0);
            b.Fallback('X', 0);
        }
Пример #2
0
        public void FallbackSequential()
        {
            Buffer b = NewInstance();

            b.Fallback('X', 0);
            b.GetNextChar();
            b.Fallback('X', 0);
        }
Пример #3
0
        public void FallbackEmptyForEncodingUTF8()
        {
            Buffer b = Encoding.UTF8.EncoderFallback.CreateFallbackBuffer() as Buffer;

            Assert.IsTrue(b.Fallback('X', 0), "#1");
            Assert.IsFalse(b.MovePrevious(), "#2");
            Assert.AreEqual(1, b.Remaining, "#3");
            // the string does not exist.
            Assert.AreEqual('\uFFFD', b.GetNextChar(), "#4");
        }
Пример #4
0
        public void FallbackEmptyDefault()
        {
            Buffer b = NewInstance();

            Assert.IsTrue(b.Fallback('X', 0), "#0");
            Assert.IsFalse(b.MovePrevious(), "#1");
            Assert.AreEqual(1, b.Remaining, "#2");
            Assert.AreEqual('?', b.GetNextChar(), "#3");
            Assert.AreEqual(0, b.Remaining, "#4");
            // the string is already consumed.
            Assert.AreEqual(char.MinValue, b.GetNextChar(), "#5");
        }