示例#1
0
        public void Bad()
        {
            var repair = new SentenceRepair(dictionary.Object, ":(", @"(.*):\((.*)", "$1bad$2");
            var result = repair.Repair("it :( it");

            Assert.AreEqual("it bad it", result);
        }
示例#2
0
        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);
        }
示例#3
0
        public void Good()
        {
            var repair = new SentenceRepair(dictionary.Object, ":)", @"(.*):\)(.*)", "$1good$2");
            var result = repair.Repair("it :) it");

            Assert.AreEqual("it good it", result);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        public void Repair()
        {
            var repair = new SentenceRepair(dictionary.Object, "Test", @"Test(\w+)", "$1");
            var result = repair.Repair("TestWord");

            Assert.AreEqual("Word", result);
        }