コード例 #1
0
 public void TestUserMaskParsingFromPrivmsg()
 {
     Assert.Equal(
         new Fullhost
     {
         Nickname = "dan",
         Username = "******",
         Hostname = "localhost"
     }, FullhostTextParser.Parse(MessageTextParser.Parse("@id=234AB :dan!d@localhost PRIVMSG #chan :Hey what's up!").Source)
         );
 }
コード例 #2
0
ファイル: SourceParserTests.cs プロジェクト: miceiken/Sonirc
        public void TestInvalidUserMasks()
        {
            var invalid = new string[]
            {
            };

            foreach (var host in invalid)
            {
                Assert.Throws <ParseException>(
                    () => FullhostTextParser.Parse(host)
                    );
            }
        }
コード例 #3
0
        public void TestValidUserMasks()
        {
            Assert.Equal(
                new Fullhost
            {
                Nickname = "dan",
                Username = "******",
                Hostname = "localhost"
            }, FullhostTextParser.Parse("dan!d@localhost")
                );

            Assert.Equal(
                new Fullhost
            {
                Nickname = "dan",
                Username = null,
                Hostname = "localhost"
            }, FullhostTextParser.Parse("dan@localhost")
                );
        }