MovePrevious() public method

public MovePrevious ( ) : bool
return bool
		public void FallbackEmptyForEncodingUTF8 ()
		{
			Buffer b = new DecoderReplacementFallbackBuffer (new DecoderReplacementFallback (String.Empty));
			Assert.IsFalse (b.Fallback (new byte [] {}, 0), "#1");
			Assert.IsFalse (b.MovePrevious (), "#2");
			Assert.AreEqual (0, b.Remaining, "#3");
			// the string does not exist.
			Assert.AreEqual (char.MinValue, b.GetNextChar (), "#4");
		}
示例#2
0
        public void FallbackDefaultEncodingUTF8()
        {
            Buffer b = Encoding.UTF8.DecoderFallback.CreateFallbackBuffer() as Buffer;

            Assert.IsTrue(b.Fallback(new byte [] {}, 0), "#1");
            Assert.IsFalse(b.MovePrevious(), "#2");
            Assert.AreEqual(1, b.Remaining, "#3");
            Assert.AreEqual('\uFFFD', b.GetNextChar(), "#4");
        }
示例#3
0
        public void FallbackEmptyDefault()
        {
            Buffer b = NewInstance();

            Assert.IsTrue(b.Fallback(new byte [] {}, 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");
        }
示例#4
0
        public void Iterate()
        {
            Assert.AreEqual('\0', Encoding.UTF8.DecoderFallback
                            .CreateFallbackBuffer().GetNextChar(), "#1");

            Buffer b = NewInstance();

//			Assert.AreEqual (1, b.Remaining, "#2");
//			Assert.AreEqual ('?', b.GetNextChar (), "#3");
            Assert.AreEqual(0, b.Remaining, "#4");
            Assert.AreEqual('\0', b.GetNextChar(), "#5");
//			Assert.IsTrue (b.MovePrevious (), "#6");
//			Assert.AreEqual (1, b.Remaining, "#7");
            Assert.IsFalse(b.MovePrevious(), "#8");
//			Assert.AreEqual ('?', b.GetNextChar (), "#9");
        }