Example #1
0
        public void NonVote_9()
        {
            string   line     = "~~[x] Invalid prefix";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #2
0
        public void NonVote_10()
        {
            string   line     = "[-2] Invalid rank";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #3
0
        public void NonVote_8()
        {
            string   line     = "[-x] Improperly placed prefix";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #4
0
        public void NonVote_6()
        {
            string   line     = "{x] Wrong brackets";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #5
0
        public void NonVote_1()
        {
            string   line     = "A basic vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #6
0
        public void NonVote_2()
        {
            string   line     = "A discussion.  Make sure to [X] your vote.";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #7
0
        public void NonVote_3()
        {
            string   line     = "[JK] A joke vote";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #8
0
        public void NonVote_5()
        {
            string   line     = "[] Forgot to x the vote";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #9
0
        public void NonVote_4()
        {
            string   line     = "--- Waaaait a minute...";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #10
0
        public void NonVote_7()
        {
            string   line     = "[[x] More wrong brackets";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            Assert.AreEqual(null, voteLine);
        }
Example #11
0
        public void Marker_Disapproval()
        {
            string   line     = "[-] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("-", voteLine.Marker);
                Assert.AreEqual(MarkerType.Approval, voteLine.MarkerType);
                Assert.AreEqual(20, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #12
0
        public void Marker_Score_Overflow()
        {
            string   line     = "[200%] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("200%", voteLine.Marker);
                Assert.AreEqual(MarkerType.Score, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #13
0
        public void Marker_HighRank()
        {
            string   line     = "[#10] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("#10", voteLine.Marker);
                Assert.AreEqual(MarkerType.Rank, voteLine.MarkerType);
                Assert.AreEqual(9, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #14
0
        public void Marker_BracketedCheckbox()
        {
            string   line     = "[☑] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("☑", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #15
0
        public void Task_Bold()
        {
            string   line     = "[X][『b』Tasky『/b』] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("Tasky", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #16
0
        public void Task_Complex_Spacing()
        {
            string   line     = "[X]  [Do you~~Go!] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("Do you~~Go!", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #17
0
        public void Prefix_DashEmDash()
        {
            string   line     = "-—[x] A normal vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("-—", voteLine.Prefix);
                Assert.AreEqual(2, voteLine.Depth);
                Assert.AreEqual("x", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #18
0
        public void General_Bold_Full()
        {
            string   line     = "『b』[X][Tasky] A normal vote line『/b』";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("A normal vote line", voteLine.CleanContent);
                Assert.AreEqual("Tasky", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #19
0
        public void Unbalanced_Multiple_Missing_Middle()
        {
            string   line     = "[X][Tasky] 『b』『i』Vote for stuff『/b』";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("『b』Vote for stuff『/b』", voteLine.Content);
                Assert.AreEqual("Vote for stuff", voteLine.CleanContent);
                Assert.AreEqual("Tasky", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #20
0
        public void Unbalanced_Early_Content()
        {
            string   line     = "[X][Tasky] A normal 『b』vote line";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("A normal vote line", voteLine.Content);
                Assert.AreEqual("A normal vote line", voteLine.CleanContent);
                Assert.AreEqual("Tasky", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #21
0
        public void Unbalanced_Multiple_Long_Colors()
        {
            string   line     = "[X][Tasky] Brutalize them. You haven’t had a chance to properly fight in 『/color』『i』『color=#ebebeb』years『/color』『/i』『color=#ebebeb』, and spars can only do so much. How thoughtful of the Herans to volunteer!";
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                // Convert ’ to '
                Assert.AreEqual("Brutalize them. You haven't had a chance to properly fight in 『i』『color=#ebebeb』years『/color』『/i』, and spars can only do so much. How thoughtful of the Herans to volunteer!", voteLine.Content);
                Assert.AreEqual("Brutalize them. You haven't had a chance to properly fight in years, and spars can only do so much. How thoughtful of the Herans to volunteer!", voteLine.CleanContent);
                Assert.AreEqual("Tasky", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }
Example #22
0
        public void General_Bold_Task()
        {
            string line = @"[X]『i』『b』[Shopping]『/b』『/i』 Shopping 1";
            // Poor matching may result in the Content ==> 『i』『b』『/b』『/i』 Shopping 1
            VoteLine?voteLine = VoteLineParser.ParseLine(line);

            if (voteLine != null)
            {
                Assert.AreEqual("", voteLine.Prefix);
                Assert.AreEqual(0, voteLine.Depth);
                Assert.AreEqual("X", voteLine.Marker);
                Assert.AreEqual(MarkerType.Vote, voteLine.MarkerType);
                Assert.AreEqual(100, voteLine.MarkerValue);
                Assert.AreEqual("Shopping 1", voteLine.Content);
                Assert.AreEqual("Shopping 1", voteLine.CleanContent);
                Assert.AreEqual("Shopping", voteLine.Task);
            }

            Assert.AreNotEqual(null, voteLine);
        }