using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; namespace ScrewTurn.Wiki.Tests { [TestFixture] public class ReverseFormatterTests { [Test] [TestCase("text", "'''text'''")] [TestCase("text", "'''text'''")] [TestCase("text", "''text''")] [TestCase("text", "''text''")] [TestCase("text", "__text__")] [TestCase("text", "--text--")] [TestCase("

text

", "==text==")] [TestCase("

text

", "===text===")] [TestCase("

text

", "====text====")] [TestCase("

text", "=====text=====")] [TestCase("text", "text")] [TestCase("text", "text")] [TestCase("
text
", "@@text@@")] [TestCase("text", "{{'''text'''}}")] [TestCase("
text
", "(((text))){br}")] [TestCase("
text
", "text{br}")] [TestCase("
  1. 1
  2. 2
", "# 1{br}# 2{br}{br}")] [TestCase("", "* 1{br}* 2{br}{br}")] //[TestCase("", "* it 1{br}** 1.1{br}** 1.2{br}* it2{br}{br}")] //[TestCase("", "* it 1{br}*# 1.1{br}*# 1.2{br}* it2{br}{br}")] [TestCase("I'm an anchor", "[anchor|#init]I'm an anchor")] [TestCase("This recall an anchor", "[#init|This recall an anchor]")] [TestCase("BIG TITLE", "[^google.com|BIG TITLE]")] [TestCase("try to esc tag", "try to esc tag")] [TestCase("
\"left

leftalign

", "[imageleft|leftalign|{UP(MainPage)}image.png|^www.link.com]{br}")] [TestCase("\"inlineimage\"", "[image|inlineimage|{UP(MainPage)}image.png]{br}")] [TestCase("
\"autoalign\"

autoalign

", "[imageauto|autoalign|{UP(MainPage)}image.png]{br}")] [TestCase("
\"Auto

Auto align

", "[imageauto|Auto align|{UP(MainPage)}image.png|^www.link.com]")] public void PlainTest(string input, string output) { Assert.AreEqual(output, ReverseFormatter.ReverseFormat(input)); } } }