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) ); }
public void TestInvalidUserMasks() { var invalid = new string[] { }; foreach (var host in invalid) { Assert.Throws <ParseException>( () => FullhostTextParser.Parse(host) ); } }
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") ); }