public void ChooseRendering_RuleApplies_RenderingMatchFound_Suffix()
        {
            var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"{0}\w*ed\b", "o\u0301$");

            Assert.AreEqual("sano\u0301", selectRenderingEndingInBAfterWith.ChooseRendering(
                                "Was the woman healed?", new Word[] { "heal" }, new[] { "sanaba", "sano\u0301", "curaba", "curo\u0301" }));
        }
        public void ChooseRendering_RuleApplies_RenderingMatchFound_Prefix()
        {
            var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"\bpre\w*{0}", @"^pre");

            Assert.AreEqual("preRendering", selectRenderingEndingInBAfterWith.ChooseRendering(
                                "What is a prebaptism ceremony?", new Word[] { "bapt" }, new[] { "unRendering preacher", "preRendering", "antiRendering" }));
        }
        public void ChooseRendering_RuleApplies_RenderingMatchFound_PrecedingWord()
        {
            var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"\bwith {0}", @"b$");

            Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
                                "Why even bother with Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_RuleApplies_RenderingMatchFound_FollowingWord()
        {
            var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"{0} for\b", @"b$");

            Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
                                "Was Mark for or against discipleship?", new Word[] { "Mark" }, new[] { "bob Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_InvalidRenderingMatchExpr_BadRegex()
        {
            var bogusRule = new RenderingSelectionRule(@"about\b {0}", @"a)");

            Assert.IsNull(bogusRule.ChooseRendering(
                              "Is this a question about Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_RuleDoesNotApply_TermNotInQuestion()
        {
            var selectRenderingEndingInAAfterXyz = new RenderingSelectionRule(@"\bwith {0}", @"a$");

            Assert.IsNull(selectRenderingEndingInAAfterXyz.ChooseRendering(
                              "Why even bother with a dude named Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_RuleApplies_RenderingMatchNotFound()
        {
            var selectRenderingEndingInCAfterWith = new RenderingSelectionRule(@"\bwith\b {0}", @"c$");

            Assert.IsNull(selectRenderingEndingInCAfterWith.ChooseRendering(
                              "Why even bother with Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_InvalidQuestionMatchExpr_NoKeyTermPlaceholder()
        {
            var bogusRule = new RenderingSelectionRule(@"\bxyz\b", "a$");

            Assert.IsNull(bogusRule.ChooseRendering(
                              "Is this a question about xyz?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
        }
        public void ChooseRendering_RuleApplies_MultiWordTermMatch()
        {
            var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"Why {0}", @"b$");

            Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
                                "Why even - bother - with Mark?", new Word[] { "even", "bother", "with" }, new[] { "Renderinga", "Renderingb" }));
        }
		public void ChooseRendering_RuleApplies_MultiWordTermMatch()
		{
			var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"Why {0}", @"b$");
			Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
				"Why even - bother - with Mark?", new Word[] { "even", "bother", "with" }, new[] { "Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_RuleApplies_RenderingMatchNotFound()
		{
			var selectRenderingEndingInCAfterWith = new RenderingSelectionRule(@"\bwith\b {0}", @"c$");
			Assert.IsNull(selectRenderingEndingInCAfterWith.ChooseRendering(
				"Why even bother with Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_RuleApplies_RenderingMatchFound_Prefix()
		{
			var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"\bpre\w*{0}", @"^pre");
			Assert.AreEqual("preRendering", selectRenderingEndingInBAfterWith.ChooseRendering(
				"What is a prebaptism ceremony?", new Word[] { "bapt" }, new[] { "unRendering preacher", "preRendering", "antiRendering" }));
		}
		public void ChooseRendering_RuleApplies_RenderingMatchFound_Suffix()
		{
			var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"{0}\w*ed\b", "o\u0301$");
			Assert.AreEqual("sano\u0301", selectRenderingEndingInBAfterWith.ChooseRendering(
				"Was the woman healed?", new Word[] { "heal" }, new[] { "sanaba", "sano\u0301", "curaba", "curo\u0301" }));
		}
		public void ChooseRendering_RuleApplies_RenderingMatchFound_FollowingWord()
		{
			var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"{0} for\b", @"b$");
			Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
				"Was Mark for or against discipleship?", new Word[] { "Mark" }, new[] { "bob Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_RuleApplies_RenderingMatchFound_PrecedingWord()
		{
			var selectRenderingEndingInBAfterWith = new RenderingSelectionRule(@"\bwith {0}", @"b$");
			Assert.AreEqual("Renderingb", selectRenderingEndingInBAfterWith.ChooseRendering(
				"Why even bother with Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_RuleDoesNotApply_TermNotInQuestion()
		{
			var selectRenderingEndingInAAfterXyz = new RenderingSelectionRule(@"\bwith {0}", @"a$");
			Assert.IsNull(selectRenderingEndingInAAfterXyz.ChooseRendering(
				"Why even bother with a dude named Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_InvalidRenderingMatchExpr_BadRegex()
		{
			var bogusRule = new RenderingSelectionRule(@"about\b {0}", @"a)");
			Assert.IsNull(bogusRule.ChooseRendering(
				"Is this a question about Mark?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
		}
		public void ChooseRendering_InvalidQuestionMatchExpr_NoKeyTermPlaceholder()
		{
			var bogusRule = new RenderingSelectionRule(@"\bxyz\b", "a$");
			Assert.IsNull(bogusRule.ChooseRendering(
				"Is this a question about xyz?", new Word[] { "Mark" }, new[] { "Renderinga", "Renderingb" }));
		}