示例#1
0
        public void CorrectingErrorMode()
        {
            Assert.True(BBCodeTestUtil.IsValid(@"", ErrorMode.TryErrorCorrection));
            Assert.True(BBCodeTestUtil.IsValid(@"[b]abc[/b]", ErrorMode.TryErrorCorrection));
            Assert.True(BBCodeTestUtil.IsValid(@"[b]abc", ErrorMode.TryErrorCorrection));

            Assert.Equal(@"\", BBEncodeForTest(@"\", ErrorMode.TryErrorCorrection));
            Assert.Equal(@"\x", BBEncodeForTest(@"\x", ErrorMode.TryErrorCorrection));
            Assert.Equal(@"\", BBEncodeForTest(@"\\", ErrorMode.TryErrorCorrection));
        }
示例#2
0
 public void StrictErrorMode()
 {
     Assert.True(BBCodeTestUtil.IsValid(@"", ErrorMode.Strict));
     Assert.True(BBCodeTestUtil.IsValid(@"[b]abc[/b]", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"[b]abc", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"abc[0]def", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"\", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"\x", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"[", ErrorMode.Strict));
     Assert.False(BBCodeTestUtil.IsValid(@"]", ErrorMode.Strict));
 }