Пример #1
0
        public void FindSentenceContainingTestValid()
        {
            string[] text = new string[] {
                "This is a (target) test for message without any real sentences",
                "This is a (target) test for message.",
                "This is a (target) test. for message",
                "This is a (target. ) test for message",
                "A prelim sentence. This is a target message.",
                "A prelim sentence. This is a target message. And a final sentence.",
                "Many sentences. Heres another. A prelim sentence. This is a target message.",
                "Many sentences. Heres another.   This is a target message.   And a final sentence. More, more.",
                "target: some stuff. And more stuff.",
                "Let's go team! Hey @target, when you releasing doing 1.0? Please let us know asap",
            };
            string[] expected = new string[] {
                text[0],
                text[1],
                "This is a (target) test.",
                "This is a (target.",
                "This is a target message.",
                "This is a target message.",
                "This is a target message.",
                "This is a target message.",
                "target: some stuff.",
                "Hey @target, when you releasing doing 1.0?"
            };

            string target = "target";

            Assert.AreEqual(text.Length, expected.Length);
            for (int i = 0; i < text.Length; i++)
            {
                string actual = Utils_Accessor.FindSentenceContaining(text[i], target);
                Assert.AreEqual(expected[i], actual, i.ToString());
            }
        }