about summary refs log tree commit diff
path: root/IrcTokens/Tests/StatefulDecoderTests.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-04-22 16:28:51 -0400
committerBen Harris <ben@tilde.team>2020-04-22 16:28:51 -0400
commit933a4f85604e21445c9bac8272d64cf3e6f65e00 (patch)
tree5b300ca37beff5cf11ed67a8b6e3550d24cf18a3 /IrcTokens/Tests/StatefulDecoderTests.cs
parent338763fde71ba2dc0de8ea5e2437d24ee365874b (diff)
rename to IrcSharp
also tidy up formatting with vs tools
Diffstat (limited to 'IrcTokens/Tests/StatefulDecoderTests.cs')
-rw-r--r--IrcTokens/Tests/StatefulDecoderTests.cs87
1 files changed, 0 insertions, 87 deletions
diff --git a/IrcTokens/Tests/StatefulDecoderTests.cs b/IrcTokens/Tests/StatefulDecoderTests.cs
deleted file mode 100644
index 3e6a078..0000000
--- a/IrcTokens/Tests/StatefulDecoderTests.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace IrcTokens.Tests
-{
-    [TestClass]
-    public class StatefulDecoderTests
-    {
-        private StatefulDecoder _decoder;
-
-        [TestInitialize]
-        public void TestInitialize()
-        {
-            _decoder = new StatefulDecoder();
-        }
-
-        [TestMethod]
-        public void TestPartial()
-        {
-            var lines = _decoder.Push("PRIVMSG ");
-            Assert.AreEqual(0, lines.Count);
-
-            lines = _decoder.Push("#channel hello\r\n");
-            Assert.AreEqual(1, lines.Count);
-
-            var line = new Line("PRIVMSG #channel hello");
-            CollectionAssert.AreEqual(new List<Line> {line}, lines);
-        }
-
-        [TestMethod]
-        public void TestMultiple()
-        {
-            var lines = _decoder.Push("PRIVMSG #channel1 hello\r\nPRIVMSG #channel2 hello\r\n");
-            Assert.AreEqual(2, lines.Count);
-
-            var line1 = new Line("PRIVMSG #channel1 hello");
-            var line2 = new Line("PRIVMSG #channel2 hello");
-            Assert.AreEqual(line1, lines[0]);
-            Assert.AreEqual(line2, lines[1]);
-        }
-
-        [TestMethod]
-        public void TestEncoding()
-        {
-            var iso8859 = Encoding.GetEncoding("iso-8859-1");
-            _decoder = new StatefulDecoder {Encoding = iso8859};
-            var lines = _decoder.Push(iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"));
-            var line = new Line("PRIVMSG #channel :hello Ç");
-            Assert.IsTrue(line.Equals(lines[0]));
-        }
-
-        [TestMethod]
-        public void TestEncodingFallback()
-        {
-            var latin1 = Encoding.GetEncoding("iso-8859-1");
-            _decoder = new StatefulDecoder {Encoding = null, Fallback = latin1};
-            var lines = _decoder.Push(latin1.GetBytes("PRIVMSG #channel hélló\r\n"));
-            Assert.AreEqual(1, lines.Count);
-            Assert.IsTrue(new Line("PRIVMSG #channel hélló").Equals(lines[0]));
-        }
-
-        [TestMethod]
-        public void TestEmpty()
-        {
-            var lines = _decoder.Push(string.Empty);
-            Assert.IsNull(lines);
-        }
-
-        [TestMethod]
-        public void TestBufferUnfinished()
-        {
-            _decoder.Push("PRIVMSG #channel hello");
-            var lines = _decoder.Push(string.Empty);
-            Assert.IsNull(lines);
-        }
-
-        [TestMethod]
-        public void TestClear()
-        {
-            _decoder.Push("PRIVMSG ");
-            _decoder.Clear();
-            Assert.AreEqual(string.Empty, _decoder.Pending);
-        }
-    }
-}