Beispiel #1
0
        public void Analyze_non_vote_color()
        {
            string text = "『color=transparent』##### NetTally『/color』";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsTrue(flagIgnore);
        }
Beispiel #2
0
        public void Analyze_non_vote_bold()
        {
            string text = "##『b』##『/b』# NetTally";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsTrue(flagIgnore);
        }
Beispiel #3
0
        public void Analyze__preliminary()
        {
            string text = "--[] Preliminary vote";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsFalse(flagIgnore);
        }
Beispiel #4
0
        public void Analyze_joke()
        {
            string text = "[jk] just kidding!";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsFalse(flagIgnore);
        }
Beispiel #5
0
        public void Analyze_bad_prefix()
        {
            string text = "--*[x] Is vote?";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsFalse(flagIgnore);
        }
Beispiel #6
0
        public void Analyze_basic_text()
        {
            string text = "Something or other";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsFalse(isVoteLine);
            Assert.IsFalse(flagIgnore);
        }
Beispiel #7
0
        public void Analyze_bold_inner_task()
        {
            string text = "[x] 『b』[『b』simple『/b』 task] Is vote?『/b』";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsTrue(isVoteLine);
            Assert.IsFalse(flagIgnore);
            Assert.AreEqual("", voteLine.Prefix);
            Assert.AreEqual("x", voteLine.Marker);
            Assert.AreEqual("simple task", voteLine.Task);
            Assert.AreEqual("『b』Is vote?『/b』", voteLine.Content);
            Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
            Assert.AreEqual(0, voteLine.MarkerValue);
        }
Beispiel #8
0
        public void Analyze_task_simple()
        {
            string text = "[x] [simple task] Is vote?";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsTrue(isVoteLine);
            Assert.IsFalse(flagIgnore);
            Assert.AreEqual("", voteLine.Prefix);
            Assert.AreEqual("x", voteLine.Marker);
            Assert.AreEqual("simple task", voteLine.Task);
            Assert.AreEqual("Is vote?", voteLine.Content);
            Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
            Assert.AreEqual(0, voteLine.MarkerValue);
        }
Beispiel #9
0
        public void Analyze_rank_default()
        {
            string text = "[1] Is vote?";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsTrue(isVoteLine);
            Assert.IsFalse(flagIgnore);
            Assert.AreEqual("", voteLine.Prefix);
            Assert.AreEqual("1", voteLine.Marker);
            Assert.AreEqual("", voteLine.Task);
            Assert.AreEqual("Is vote?", voteLine.Content);
            Assert.AreEqual(MarkerType.Rank, voteLine.MarkerType);
            Assert.AreEqual(1, voteLine.MarkerValue);
        }
Beispiel #10
0
        public void Analyze_score()
        {
            string text = "[+9] Is vote?";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsTrue(isVoteLine);
            Assert.IsFalse(flagIgnore);
            Assert.AreEqual("", voteLine.Prefix);
            Assert.AreEqual("+9", voteLine.Marker);
            Assert.AreEqual("", voteLine.Task);
            Assert.AreEqual("Is vote?", voteLine.Content);
            Assert.AreEqual(MarkerType.Score, voteLine.MarkerType);
            Assert.AreEqual(9, voteLine.MarkerValue);
        }
Beispiel #11
0
        public void Analyze_approval_negative()
        {
            string text = "[-] Is vote?";

            var(isVoteLine, flagIgnore, voteLine) = MessageVoteContent.AnalyzeLine(text);

            Assert.IsTrue(isVoteLine);
            Assert.IsFalse(flagIgnore);
            Assert.AreEqual("", voteLine.Prefix);
            Assert.AreEqual("-", voteLine.Marker);
            Assert.AreEqual("", voteLine.Task);
            Assert.AreEqual("Is vote?", voteLine.Content);
            Assert.AreEqual(MarkerType.Approval, voteLine.MarkerType);
            Assert.AreEqual(-1, voteLine.MarkerValue);
        }