public void Bad() { var repair = new SentenceRepair(dictionary.Object, ":(", @"(.*):\((.*)", "$1bad$2"); var result = repair.Repair("it :( it"); Assert.AreEqual("it bad it", result); }
public void Alot() { var repair = new SentenceRepair(dictionary.Object, "a lot of", @"(.*)a lot of(.*)", "$1alot$2"); var result = repair.Repair("it is a lot of better"); Assert.AreEqual("it is alot better", result); }
public void Good() { var repair = new SentenceRepair(dictionary.Object, ":)", @"(.*):\)(.*)", "$1good$2"); var result = repair.Repair("it :) it"); Assert.AreEqual("it good it", result); }
public void Blows3() { var repair = new SentenceRepair(dictionary.Object, "blows", @"(.*)blows(.*) out of( the)? water(.*)", "$1is better then$2$4"); var result = repair.Repair("it blows out of water"); Assert.AreEqual("it is better then", result); }
public void EasyToUse() { var repair = new SentenceRepair(dictionary.Object, "easy to use", @"(.*)easy to use(.*)", "$1good$2"); var result = repair.Repair("It is easy to use at home"); Assert.AreEqual("It is good at home", result); }
public void RepairNotOnly() { var repair = new SentenceRepair(dictionary.Object, "Not only", @"(.*) Not only(.*)but also(.*)", "$1$2and$3"); var result = repair.Repair("We not only brought this book but also liked it"); Assert.AreEqual("We brought this book and liked it", result); }
public void Repair() { var repair = new SentenceRepair(dictionary.Object, "Test", @"Test(\w+)", "$1"); var result = repair.Repair("TestWord"); Assert.AreEqual("Word", result); }