Пример #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
        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")
                );
        }