about summary refs log tree commit diff
path: root/IrcTokens/Tests/StatefulEncoderTests.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/StatefulEncoderTests.cs
parent338763fde71ba2dc0de8ea5e2437d24ee365874b (diff)
rename to IrcSharp
also tidy up formatting with vs tools
Diffstat (limited to 'IrcTokens/Tests/StatefulEncoderTests.cs')
-rw-r--r--IrcTokens/Tests/StatefulEncoderTests.cs72
1 files changed, 0 insertions, 72 deletions
diff --git a/IrcTokens/Tests/StatefulEncoderTests.cs b/IrcTokens/Tests/StatefulEncoderTests.cs
deleted file mode 100644
index 477b38d..0000000
--- a/IrcTokens/Tests/StatefulEncoderTests.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace IrcTokens.Tests
-{
-    [TestClass]
-    public class StatefulEncoderTests
-    {
-        private StatefulEncoder _encoder;
-
-        [TestInitialize]
-        public void TestInitialize()
-        {
-            _encoder = new StatefulEncoder();
-        }
-
-        [TestMethod]
-        public void TestPush()
-        {
-            var line = new Line("PRIVMSG #channel hello");
-            _encoder.Push(line);
-            Assert.AreEqual("PRIVMSG #channel hello\r\n", _encoder.Pending());
-        }
-
-        [TestMethod]
-        public void TestPopPartial()
-        {
-            var line = new Line("PRIVMSG #channel hello");
-            _encoder.Push(line);
-            _encoder.Pop("PRIVMSG #channel hello".Length);
-            Assert.AreEqual("\r\n", _encoder.Pending());
-        }
-
-        [TestMethod]
-        public void TestPopReturned()
-        {
-            var line = new Line("PRIVMSG #channel hello");
-            _encoder.Push(line);
-            _encoder.Push(line);
-            var lines = _encoder.Pop("PRIVMSG #channel hello\r\n".Length);
-            Assert.AreEqual(1, lines.Count);
-            Assert.AreEqual(line, lines[0]);
-        }
-
-        [TestMethod]
-        public void TestPopNoneReturned()
-        {
-            var line = new Line("PRIVMSG #channel hello");
-            _encoder.Push(line);
-            var lines = _encoder.Pop(1);
-            Assert.AreEqual(0, lines.Count);
-        }
-
-        [TestMethod]
-        public void TestClear()
-        {
-            _encoder.Push(new Line("PRIVMSG #channel hello"));
-            _encoder.Clear();
-            Assert.AreEqual(string.Empty, _encoder.Pending());
-        }
-
-        [TestMethod]
-        public void TestEncoding()
-        {
-            var iso8859 = Encoding.GetEncoding("iso-8859-1");
-            _encoder = new StatefulEncoder {Encoding = iso8859};
-            _encoder.Push(new Line("PRIVMSG #channel :hello Ç"));
-            CollectionAssert.AreEqual(iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"), _encoder.PendingBytes);
-        }
-    }
-}