From 933a4f85604e21445c9bac8272d64cf3e6f65e00 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 22 Apr 2020 16:28:51 -0400 Subject: rename to IrcSharp also tidy up formatting with vs tools --- IrcTokens/Tests/TokenizationTests.cs | 118 ----------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 IrcTokens/Tests/TokenizationTests.cs (limited to 'IrcTokens/Tests/TokenizationTests.cs') diff --git a/IrcTokens/Tests/TokenizationTests.cs b/IrcTokens/Tests/TokenizationTests.cs deleted file mode 100644 index 6d8a69d..0000000 --- a/IrcTokens/Tests/TokenizationTests.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace IrcTokens.Tests -{ - [TestClass] - public class TokenizationTests - { - [TestMethod] - public void TestTagsMissing() - { - var line = new Line("PRIVMSG #channel"); - Assert.IsNull(line.Tags); - } - - [TestMethod] - public void TestTagsMissingValue() - { - var line = new Line("@id= PRIVMSG #channel"); - Assert.AreEqual(string.Empty, line.Tags["id"]); - } - - [TestMethod] - public void TestTagsMissingEqual() - { - var line = new Line("@id PRIVMSG #channel"); - Assert.AreEqual(string.Empty, line.Tags["id"]); - } - - [TestMethod] - public void TestTagsUnescape() - { - var line = new Line(@"@id=1\\\:\r\n\s2 PRIVMSG #channel"); - Assert.AreEqual("1\\;\r\n 2", line.Tags["id"]); - } - - [TestMethod] - public void TestTagsOverlap() - { - var line = new Line(@"@id=1\\\s\\s PRIVMSG #channel"); - Assert.AreEqual("1\\ \\s", line.Tags["id"]); - } - - [TestMethod] - public void TestTagsLoneEndSlash() - { - var line = new Line("@id=1\\ PRIVMSG #channel"); - Assert.AreEqual("1", line.Tags["id"]); - } - - [TestMethod] - public void TestSourceWithoutTags() - { - var line = new Line(":nick!user@host PRIVMSG #channel"); - Assert.AreEqual("nick!user@host", line.Source); - } - - [TestMethod] - public void TestSourceWithTags() - { - var line = new Line("@id=123 :nick!user@host PRIVMSG #channel"); - Assert.AreEqual("nick!user@host", line.Source); - } - - [TestMethod] - public void TestSourceMissingWithoutTags() - { - var line = new Line("PRIVMSG #channel"); - Assert.IsNull(line.Source); - } - - [TestMethod] - public void TestSourceMissingWithTags() - { - var line = new Line("@id=123 PRIVMSG #channel"); - Assert.IsNull(line.Source); - } - - [TestMethod] - public void TestCommand() - { - var line = new Line("privmsg #channel"); - Assert.AreEqual("PRIVMSG", line.Command); - } - - [TestMethod] - public void TestParamsTrailing() - { - var line = new Line("PRIVMSG #channel :hello world"); - CollectionAssert.AreEqual(new List {"#channel", "hello world"}, line.Params); - } - - [TestMethod] - public void TestParamsOnlyTrailing() - { - var line = new Line("PRIVMSG :hello world"); - CollectionAssert.AreEqual(new List {"hello world"}, line.Params); - } - - [TestMethod] - public void TestParamsMissing() - { - var line = new Line("PRIVMSG"); - Assert.AreEqual("PRIVMSG", line.Command); - CollectionAssert.AreEqual(new List(), line.Params); - } - - [TestMethod] - public void TestAllTokens() - { - var line = new Line("@id=123 :nick!user@host PRIVMSG #channel :hello world"); - CollectionAssert.AreEqual(new Dictionary {{"id", "123"}}, line.Tags); - Assert.AreEqual("nick!user@host", line.Source); - Assert.AreEqual("PRIVMSG", line.Command); - CollectionAssert.AreEqual(new List {"#channel", "hello world"}, line.Params); - } - } -} -- cgit 1.4.1