diff options
Diffstat (limited to 'IrcTokens/Tests/StatefulEncoderTests.cs')
-rw-r--r-- | IrcTokens/Tests/StatefulEncoderTests.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/IrcTokens/Tests/StatefulEncoderTests.cs b/IrcTokens/Tests/StatefulEncoderTests.cs index 4732573..477b38d 100644 --- a/IrcTokens/Tests/StatefulEncoderTests.cs +++ b/IrcTokens/Tests/StatefulEncoderTests.cs @@ -20,7 +20,7 @@ namespace IrcTokens.Tests { var line = new Line("PRIVMSG #channel hello"); _encoder.Push(line); - Assert.AreEqual("PRIVMSG #channel hello\r\n", _encoder.Pending); + Assert.AreEqual("PRIVMSG #channel hello\r\n", _encoder.Pending()); } [TestMethod] @@ -29,7 +29,7 @@ namespace IrcTokens.Tests var line = new Line("PRIVMSG #channel hello"); _encoder.Push(line); _encoder.Pop("PRIVMSG #channel hello".Length); - Assert.AreEqual("\r\n", _encoder.Pending); + Assert.AreEqual("\r\n", _encoder.Pending()); } [TestMethod] @@ -57,16 +57,16 @@ namespace IrcTokens.Tests { _encoder.Push(new Line("PRIVMSG #channel hello")); _encoder.Clear(); - Assert.AreEqual(string.Empty, _encoder.Pending); + Assert.AreEqual(string.Empty, _encoder.Pending()); } [TestMethod] public void TestEncoding() { - var iso88592 = Encoding.GetEncodings().Single(ei => ei.Name == "iso-8859-2"); - _encoder = new StatefulEncoder {Encoding = iso88592}; - _encoder.Push(new Line("PRIVMSG #channel :hello Č")); - Assert.AreEqual("PRIVMSG #channel :hello Č\r\n", _encoder.Pending); + 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); } } } |