Пример #1
0
        public void ToStringReturnsRawPrefix()
        {
            var prefix    = "[email protected]";
            var ircPrefix = new IrcPrefix(prefix);

            Assert.Equal(prefix, ircPrefix.ToString());
        }
Пример #2
0
        public void CanParseSimplePrefix()
        {
            var prefix    = "Nick123";
            var ircPrefix = new IrcPrefix(prefix);

            Assert.Equal(prefix, ircPrefix.From);
        }
Пример #3
0
        public void CanParsePrefixWithHost()
        {
            var prefix    = "*****@*****.**";
            var ircPrefix = new IrcPrefix(prefix);

            Assert.Equal("Nick123", ircPrefix.From);
            Assert.Equal("host.com", ircPrefix.Host);
        }
Пример #4
0
        public static bool IsIgnoreMatch(IrcPrefix prefix, IgnoreActions action)
        {
            if (prefix == null)
            {
                return(false);
            }

            return((from ignore in _ignores.Values
                    where ignore.IsMatch(prefix.Prefix, action)
                    select true).Any());
        }