コード例 #1
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestOverlongRange()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/\u1000-\u2000/\u3000-\u4000/");

            Assert.Equal(0, mgr.EventLog.Count);
        }
コード例 #2
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestInvertedRange()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/z-a/Z-A/");

            Assert.Equal(0, mgr.EventLog.Count);
        }
コード例 #3
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestRangeTransposition()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr_a-z_A-Z_");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG", sentMessage.Body);
        }
コード例 #4
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestDeleteMissingTo()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/aeiouy//d");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("th qck brwn fx jmps vr th lz dg", sentMessage.Body);
        }
コード例 #5
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestRepeatLastTo()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/aeiouy/q/r");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("thq qqqck brqwn fqx jqmps qvqr thq lqzq dqg", sentMessage.Body);
        }
コード例 #6
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestEmoji()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "lol X");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/X/\U0001F600/");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("lol \U0001F600", sentMessage.Body);
        }
コード例 #7
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestNonRangeHyphen2()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "twenty-three thousand four hundred fifty-six");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/a-d-/A-D|/");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("twenty|three thousAnD four hunDreD fifty|six", sentMessage.Body);
        }
コード例 #8
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestMultipleTranspositions()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "a one, a two, a three, a four");
            mgr.InjectChannelMessage(TestChannelName, "YetAnotherUser", " tr/a/e/ tr_o_u_  ");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("e une, e twu, e three, e fuur", sentMessage.Body);
        }
コード例 #9
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestStringTransposition()
        {
            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "the quick brown fox jumps over the lazy dog");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/aeiouy/431087/");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("th3 q81ck br0wn f0x j8mps 0v3r th3 l4z7 d0g", sentMessage.Body);
        }
コード例 #10
0
ファイル: TransposeTests.cs プロジェクト: detmach/SharpIrcBot
        public void TestGermanPangram()
        {
            // (I know that the capitalization of sharp S is currently not considered correct)

            TestConnectionManager mgr = TestCommon.ObtainConnectionManager();

            mgr.InjectChannelMessage(TestChannelName, "OneUser", "zwölf boxkämpfer jagen viktor quer über den großen sylter deich");
            mgr.InjectChannelMessage(TestChannelName, "AnotherUser", "tr/a-zäöüß/A-ZÄÖÜẞ/");

            Assert.Equal(1, mgr.EventLog.Count);
            TestMessage sentMessage = Assert.IsType <TestMessage>(mgr.EventLog[0]);

            Assert.Equal(MessageType.Message, sentMessage.Type);
            Assert.Equal(TestChannelName, sentMessage.Target);
            Assert.Equal("ZWÖLF BOXKÄMPFER JAGEN VIKTOR QUER ÜBER DEN GROẞEN SYLTER DEICH", sentMessage.Body);
        }