IRC parsing, tokenization, and state handling in C#

rename Irc to IRC

+95 -120
+2 -2
Examples/States/Client.cs
··· 2 2 using System.Linq; 3 3 using System.Net.Sockets; 4 4 using System.Threading; 5 - using IrcStates; 6 - using IrcTokens; 5 + using IRCStates; 6 + using IRCTokens; 7 7 8 8 namespace StatesSample 9 9 {
+1 -1
Examples/States/StatesSample.csproj
··· 6 6 </PropertyGroup> 7 7 8 8 <ItemGroup> 9 - <ProjectReference Include="..\..\IrcStates\IrcStates.csproj" /> 9 + <ProjectReference Include="..\..\IRCStates\IRCStates.csproj" /> 10 10 </ItemGroup> 11 11 12 12 </Project>
+1 -1
Examples/Tokens/Client.cs
··· 1 1 using System; 2 2 using System.Net.Sockets; 3 3 using System.Threading; 4 - using IrcTokens; 4 + using IRCTokens; 5 5 6 6 namespace TokensSample 7 7 {
+1 -1
Examples/Tokens/Program.cs
··· 1 1 using System; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 4 4 namespace TokensSample 5 5 {
+1 -1
Examples/Tokens/TokensSample.csproj
··· 6 6 </PropertyGroup> 7 7 8 8 <ItemGroup> 9 - <ProjectReference Include="..\..\IrcTokens\IrcTokens.csproj" /> 9 + <ProjectReference Include="..\..\IRCTokens\IRCTokens.csproj" /> 10 10 </ItemGroup> 11 11 12 12 </Project>
+15
IRCStates/Extensions.cs
··· 1 + using System.Collections.Generic; 2 + using System.Linq; 3 + 4 + namespace IRCStates 5 + { 6 + public static class Extensions 7 + { 8 + public static void UpdateWith<TKey, TValue>(this Dictionary<TKey, TValue> dict, Dictionary<TKey, TValue> other) 9 + { 10 + if (dict == null || other == null || !other.Any()) return; 11 + 12 + foreach (var (key, value) in other) dict[key] = value; 13 + } 14 + } 15 + }
+2 -2
IrcSharp.sln IRCSharp.sln
··· 3 3 # Visual Studio Version 16 4 4 VisualStudioVersion = 16.0.30011.22 5 5 MinimumVisualStudioVersion = 10.0.40219.1 6 - Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrcTokens", "IrcTokens\IrcTokens.csproj", "{9E812F45-B2CD-42D2-8378-EBEBF8697905}" 6 + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRCTokens", "IRCTokens\IRCTokens.csproj", "{9E812F45-B2CD-42D2-8378-EBEBF8697905}" 7 7 EndProject 8 8 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TokensSample", "Examples\Tokens\TokensSample.csproj", "{A45DA39B-6B47-4713-8049-3B36E0235B67}" 9 9 EndProject 10 - Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrcStates", "IrcStates\IrcStates.csproj", "{233E3CB4-61F1-4368-9139-7E9F4A58ED2D}" 10 + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRCStates", "IRCStates\IRCStates.csproj", "{233E3CB4-61F1-4368-9139-7E9F4A58ED2D}" 11 11 EndProject 12 12 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatesSample", "Examples\States\StatesSample.csproj", "{BC9F6696-9D83-4F7A-9E15-CE4D3626C1AF}" 13 13 EndProject
+1 -1
IrcStates/Casemap.cs IRCStates/Casemap.cs
··· 1 1 using System; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public static class Casemap 6 6 {
+1 -1
IrcStates/Channel.cs IRCStates/Channel.cs
··· 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 4 5 - namespace IrcStates 5 + namespace IRCStates 6 6 { 7 7 public class Channel 8 8 {
+1 -1
IrcStates/ChannelUser.cs IRCStates/ChannelUser.cs
··· 1 1 using System.Collections.Generic; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public class ChannelUser 6 6 {
+1 -1
IrcStates/Commands.cs IRCStates/Commands.cs
··· 1 - namespace IrcStates 1 + namespace IRCStates 2 2 { 3 3 public static class Commands 4 4 {
+1 -1
IrcStates/Emit.cs IRCStates/Emit.cs
··· 1 1 using System.Collections.Generic; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public class Emit 6 6 {
-40
IrcStates/Extensions.cs
··· 1 - using System; 2 - using System.Collections.Generic; 3 - using System.Linq; 4 - using System.Linq.Expressions; 5 - using System.Reflection; 6 - 7 - namespace IrcStates 8 - { 9 - public static class Extensions 10 - { 11 - public static Delegate CreateDelegate(this MethodInfo methodInfo, object target) 12 - { 13 - if (methodInfo == null) return null; 14 - 15 - var types = methodInfo.GetParameters().Select(p => p.ParameterType); 16 - 17 - Func<Type[], Type> getType; 18 - if (methodInfo.ReturnType == typeof(void)) 19 - { 20 - getType = Expression.GetActionType; 21 - } 22 - else 23 - { 24 - getType = Expression.GetFuncType; 25 - types = types.Concat(new[] {methodInfo.ReturnType}); 26 - } 27 - 28 - return methodInfo.IsStatic 29 - ? Delegate.CreateDelegate(getType(types.ToArray()), methodInfo) 30 - : Delegate.CreateDelegate(getType(types.ToArray()), target, methodInfo); 31 - } 32 - 33 - public static void UpdateWith<TKey, TValue>(this Dictionary<TKey, TValue> dict, Dictionary<TKey, TValue> other) 34 - { 35 - if (dict == null || other == null || !other.Any()) return; 36 - 37 - foreach (var (key, value) in other) dict[key] = value; 38 - } 39 - } 40 - }
+1 -1
IrcStates/ISupport.cs IRCStates/ISupport.cs
··· 5 5 using System.Globalization; 6 6 using System.Linq; 7 7 8 - namespace IrcStates 8 + namespace IRCStates 9 9 { 10 10 public class ISupport 11 11 {
+1 -1
IrcStates/ISupportChanModes.cs IRCStates/ISupportChanModes.cs
··· 2 2 using System.Globalization; 3 3 using System.Linq; 4 4 5 - namespace IrcStates 5 + namespace IRCStates 6 6 { 7 7 public class ISupportChanModes 8 8 {
+1 -1
IrcStates/ISupportPrefix.cs IRCStates/ISupportPrefix.cs
··· 3 3 using System.Globalization; 4 4 using System.Linq; 5 5 6 - namespace IrcStates 6 + namespace IRCStates 7 7 { 8 8 public class ISupportPrefix 9 9 {
+1 -1
IrcStates/IrcStates.csproj IRCStates/IRCStates.csproj
··· 15 15 </ItemGroup> 16 16 17 17 <ItemGroup> 18 - <ProjectReference Include="..\IrcTokens\IrcTokens.csproj" /> 18 + <ProjectReference Include="..\IRCTokens\IRCTokens.csproj" /> 19 19 </ItemGroup> 20 20 21 21 </Project>
+1 -1
IrcStates/Numeric.cs IRCStates/Numeric.cs
··· 1 1 // ReSharper disable InconsistentNaming 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public static class Numeric 6 6 {
IrcStates/README.md IRCStates/README.md
+2 -2
IrcStates/Server.cs IRCStates/Server.cs
··· 3 3 using System.ComponentModel.Design; 4 4 using System.Globalization; 5 5 using System.Linq; 6 - using IrcTokens; 6 + using IRCTokens; 7 7 8 - namespace IrcStates 8 + namespace IRCStates 9 9 { 10 10 public class Server 11 11 {
+1 -1
IrcStates/ServerDisconnectedException.cs IRCStates/ServerDisconnectedException.cs
··· 1 1 using System; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public class ServerDisconnectedException : Exception 6 6 {
+1 -1
IrcStates/ServerException.cs IRCStates/ServerException.cs
··· 1 1 using System; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public class ServerException : Exception 6 6 {
+2 -2
IrcStates/Tests/Cap.cs IRCStates/Tests/Cap.cs
··· 1 1 using System.Collections.Generic; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcStates.Tests 5 + namespace IRCStates.Tests 6 6 { 7 7 [TestClass] 8 8 public class Cap
+4 -4
IrcStates/Tests/Casemap.cs IRCStates/Tests/Casemap.cs
··· 1 - using IrcTokens; 1 + using IRCTokens; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcStates.Tests 4 + namespace IRCStates.Tests 5 5 { 6 6 [TestClass] 7 7 public class Casemap ··· 9 9 [TestMethod] 10 10 public void Rfc1459() 11 11 { 12 - var lower = IrcStates.Casemap.CaseFold(IrcStates.Casemap.CaseMapping.Rfc1459, @"ÀTEST[]~\"); 12 + var lower = IRCStates.Casemap.CaseFold(IRCStates.Casemap.CaseMapping.Rfc1459, @"ÀTEST[]~\"); 13 13 Assert.AreEqual("Àtest{}^|", lower); 14 14 } 15 15 16 16 [TestMethod] 17 17 public void Ascii() 18 18 { 19 - var lower = IrcStates.Casemap.CaseFold(IrcStates.Casemap.CaseMapping.Ascii, @"ÀTEST[]~\"); 19 + var lower = IRCStates.Casemap.CaseFold(IRCStates.Casemap.CaseMapping.Ascii, @"ÀTEST[]~\"); 20 20 Assert.AreEqual(@"Àtest[]~\", lower); 21 21 } 22 22
+4 -4
IrcStates/Tests/Channel.cs IRCStates/Tests/Channel.cs
··· 1 1 using System; 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 - using IrcTokens; 4 + using IRCTokens; 5 5 using Microsoft.VisualStudio.TestTools.UnitTesting; 6 6 7 - namespace IrcStates.Tests 7 + namespace IRCStates.Tests 8 8 { 9 9 [TestClass] 10 10 public class Channel ··· 69 69 var chanUser = channel.Users[user.NickNameLower]; 70 70 71 71 Assert.AreEqual(channel.NameLower, user.Channels.Single()); 72 - CollectionAssert.AreEqual(new Dictionary<string, IrcStates.User> {{"nickname", user}}, _server.Users); 73 - CollectionAssert.AreEqual(new Dictionary<string, IrcStates.Channel> {{"#chan", channel}}, _server.Channels); 72 + CollectionAssert.AreEqual(new Dictionary<string, IRCStates.User> {{"nickname", user}}, _server.Users); 73 + CollectionAssert.AreEqual(new Dictionary<string, IRCStates.Channel> {{"#chan", channel}}, _server.Channels); 74 74 CollectionAssert.AreEqual(new Dictionary<string, ChannelUser> {{"nickname", chanUser}}, channel.Users); 75 75 } 76 76
+2 -2
IrcStates/Tests/Emit.cs IRCStates/Tests/Emit.cs
··· 1 1 using System.Collections.Generic; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcStates.Tests 5 + namespace IRCStates.Tests 6 6 { 7 7 [TestClass] 8 8 public class Emit
+6 -6
IrcStates/Tests/ISupport.cs IRCStates/Tests/ISupport.cs
··· 1 1 using System.Collections.Generic; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 5 // ReSharper disable InconsistentNaming 6 6 7 - namespace IrcStates.Tests 7 + namespace IRCStates.Tests 8 8 { 9 9 [TestClass] 10 10 public class ISupport ··· 97 97 [TestMethod] 98 98 public void Rfc1459() 99 99 { 100 - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 100 + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 101 101 _server.Parse(new Line("005 * CASEMAPPING=rfc1459 *")); 102 - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 102 + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 103 103 var lower = _server.CaseFold(@"ÀTEST[]~\"); 104 104 Assert.AreEqual("Àtest{}^|", lower); 105 105 } ··· 108 108 public void Ascii() 109 109 { 110 110 _server.Parse(new Line("005 * CASEMAPPING=ascii *")); 111 - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Ascii, _server.ISupport.CaseMapping); 111 + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Ascii, _server.ISupport.CaseMapping); 112 112 var lower = _server.CaseFold(@"ÀTEST[]~\"); 113 113 Assert.AreEqual(@"Àtest[]~\", lower); 114 114 } ··· 117 117 public void FallbackToRfc1459() 118 118 { 119 119 _server.Parse(new Line("005 * CASEMAPPING=nonexistent *")); 120 - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 120 + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); 121 121 var lower = _server.CaseFold(@"ÀTEST[]~\"); 122 122 Assert.AreEqual("Àtest{}^|", lower); 123 123 }
+2 -2
IrcStates/Tests/Mode.cs IRCStates/Tests/Mode.cs
··· 1 1 using System.Collections.Generic; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcStates.Tests 5 + namespace IRCStates.Tests 6 6 { 7 7 [TestClass] 8 8 public class Mode
+2 -2
IrcStates/Tests/Motd.cs IRCStates/Tests/Motd.cs
··· 1 1 using System.Collections.Generic; 2 - using IrcTokens; 2 + using IRCTokens; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcStates.Tests 5 + namespace IRCStates.Tests 6 6 { 7 7 [TestClass] 8 8 public class Motd
+2 -2
IrcStates/Tests/Sasl.cs IRCStates/Tests/Sasl.cs
··· 1 - using IrcTokens; 1 + using IRCTokens; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcStates.Tests 4 + namespace IRCStates.Tests 5 5 { 6 6 [TestClass] 7 7 public class Sasl
+2 -2
IrcStates/Tests/User.cs IRCStates/Tests/User.cs
··· 1 - using IrcTokens; 1 + using IRCTokens; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcStates.Tests 4 + namespace IRCStates.Tests 5 5 { 6 6 [TestClass] 7 7 public class User
+2 -2
IrcStates/Tests/Who.cs IRCStates/Tests/Who.cs
··· 1 - using IrcTokens; 1 + using IRCTokens; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcStates.Tests 4 + namespace IRCStates.Tests 5 5 { 6 6 [TestClass] 7 7 public class Who
+1 -1
IrcStates/User.cs IRCStates/User.cs
··· 1 1 using System.Collections.Generic; 2 2 3 - namespace IrcStates 3 + namespace IRCStates 4 4 { 5 5 public class User 6 6 {
+1 -1
IrcTokens/Extensions.cs IRCTokens/Extensions.cs
··· 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 4 5 - namespace IrcTokens 5 + namespace IRCTokens 6 6 { 7 7 public static class Extensions 8 8 {
+1 -1
IrcTokens/Hostmask.cs IRCTokens/Hostmask.cs
··· 1 1 using System; 2 2 3 - namespace IrcTokens 3 + namespace IRCTokens 4 4 { 5 5 /// <summary> 6 6 /// Represents the three parts of a hostmask. Parse with the constructor.
IrcTokens/IrcTokens.csproj IRCTokens/IRCTokens.csproj
+1 -1
IrcTokens/Line.cs IRCTokens/Line.cs
··· 4 4 using System.Linq; 5 5 using System.Text; 6 6 7 - namespace IrcTokens 7 + namespace IRCTokens 8 8 { 9 9 /// <summary> 10 10 /// Tools to represent, parse, and format IRC lines
+2 -2
IrcTokens/README.md IRCTokens/README.md
··· 1 - # irctokens 1 + # IRCTokens 2 2 3 3 this is a c\# port of jesopo's [irctokens]( 4 4 https://github.com/jesopo/irctokens) ··· 7 7 8 8 ### tokenization 9 9 10 - using IrcTokens; 10 + using IRCTokens; 11 11 12 12 ... 13 13
+1 -1
IrcTokens/StatefulDecoder.cs IRCTokens/StatefulDecoder.cs
··· 3 3 using System.Linq; 4 4 using System.Text; 5 5 6 - namespace IrcTokens 6 + namespace IRCTokens 7 7 { 8 8 public class StatefulDecoder 9 9 {
+1 -1
IrcTokens/StatefulEncoder.cs IRCTokens/StatefulEncoder.cs
··· 3 3 using System.Linq; 4 4 using System.Text; 5 5 6 - namespace IrcTokens 6 + namespace IRCTokens 7 7 { 8 8 public class StatefulEncoder 9 9 {
+1 -1
IrcTokens/Tests/Data/JoinModel.cs IRCTokens/Tests/Data/JoinModel.cs
··· 1 1 using System.Collections.Generic; 2 2 using YamlDotNet.Serialization; 3 3 4 - namespace IrcTokens.Tests.Data 4 + namespace IRCTokens.Tests.Data 5 5 { 6 6 public class JoinModel 7 7 {
+1 -1
IrcTokens/Tests/Data/SplitModel.cs IRCTokens/Tests/Data/SplitModel.cs
··· 1 1 using System.Collections.Generic; 2 2 3 - namespace IrcTokens.Tests.Data 3 + namespace IRCTokens.Tests.Data 4 4 { 5 5 public class SplitModel 6 6 {
IrcTokens/Tests/Data/msg-join.yaml IRCTokens/Tests/Data/msg-join.yaml
IrcTokens/Tests/Data/msg-split.yaml IRCTokens/Tests/Data/msg-split.yaml
+1 -1
IrcTokens/Tests/Format.cs IRCTokens/Tests/Format.cs
··· 2 2 using System.Collections.Generic; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcTokens.Tests 5 + namespace IRCTokens.Tests 6 6 { 7 7 [TestClass] 8 8 public class Format
+6 -6
IrcTokens/Tests/Hostmask.cs IRCTokens/Tests/Hostmask.cs
··· 1 1 using Microsoft.VisualStudio.TestTools.UnitTesting; 2 2 3 - namespace IrcTokens.Tests 3 + namespace IRCTokens.Tests 4 4 { 5 5 [TestClass] 6 6 public class Hostmask ··· 8 8 [TestMethod] 9 9 public void TestHostmask() 10 10 { 11 - var hostmask = new IrcTokens.Hostmask("nick!user@host"); 11 + var hostmask = new IRCTokens.Hostmask("nick!user@host"); 12 12 Assert.AreEqual("nick", hostmask.NickName); 13 13 Assert.AreEqual("user", hostmask.UserName); 14 14 Assert.AreEqual("host", hostmask.HostName); ··· 17 17 [TestMethod] 18 18 public void TestNoHostName() 19 19 { 20 - var hostmask = new IrcTokens.Hostmask("nick!user"); 20 + var hostmask = new IRCTokens.Hostmask("nick!user"); 21 21 Assert.AreEqual("nick", hostmask.NickName); 22 22 Assert.AreEqual("user", hostmask.UserName); 23 23 Assert.IsNull(hostmask.HostName); ··· 26 26 [TestMethod] 27 27 public void TestNoUserName() 28 28 { 29 - var hostmask = new IrcTokens.Hostmask("nick@host"); 29 + var hostmask = new IRCTokens.Hostmask("nick@host"); 30 30 Assert.AreEqual("nick", hostmask.NickName); 31 31 Assert.IsNull(hostmask.UserName); 32 32 Assert.AreEqual("host", hostmask.HostName); ··· 35 35 [TestMethod] 36 36 public void TestOnlyNickName() 37 37 { 38 - var hostmask = new IrcTokens.Hostmask("nick"); 38 + var hostmask = new IRCTokens.Hostmask("nick"); 39 39 Assert.AreEqual("nick", hostmask.NickName); 40 40 Assert.IsNull(hostmask.UserName); 41 41 Assert.IsNull(hostmask.HostName); ··· 45 45 public void TestHostmaskFromLine() 46 46 { 47 47 var line = new Line(":nick!user@host PRIVMSG #channel hello"); 48 - var hostmask = new IrcTokens.Hostmask("nick!user@host"); 48 + var hostmask = new IRCTokens.Hostmask("nick!user@host"); 49 49 Assert.AreEqual(hostmask.ToString(), line.Hostmask.ToString()); 50 50 Assert.AreEqual("nick", line.Hostmask.NickName); 51 51 Assert.AreEqual("user", line.Hostmask.UserName);
+2 -2
IrcTokens/Tests/Parser.cs IRCTokens/Tests/Parser.cs
··· 1 1 using System.Collections.Generic; 2 2 using System.Globalization; 3 3 using System.IO; 4 - using IrcTokens.Tests.Data; 4 + using IRCTokens.Tests.Data; 5 5 using Microsoft.VisualStudio.TestTools.UnitTesting; 6 6 using YamlDotNet.Serialization; 7 7 using YamlDotNet.Serialization.NamingConventions; 8 8 9 - namespace IrcTokens.Tests 9 + namespace IRCTokens.Tests 10 10 { 11 11 [TestClass] 12 12 public class Parser
+5 -5
IrcTokens/Tests/StatefulDecoder.cs IRCTokens/Tests/StatefulDecoder.cs
··· 2 2 using System.Text; 3 3 using Microsoft.VisualStudio.TestTools.UnitTesting; 4 4 5 - namespace IrcTokens.Tests 5 + namespace IRCTokens.Tests 6 6 { 7 7 [TestClass] 8 8 public class StatefulDecoder 9 9 { 10 - private IrcTokens.StatefulDecoder _decoder; 10 + private IRCTokens.StatefulDecoder _decoder; 11 11 12 12 [TestInitialize] 13 13 public void TestInitialize() 14 14 { 15 - _decoder = new IrcTokens.StatefulDecoder(); 15 + _decoder = new IRCTokens.StatefulDecoder(); 16 16 } 17 17 18 18 [TestMethod] ··· 44 44 public void TestEncoding() 45 45 { 46 46 var iso8859 = Encoding.GetEncoding("iso-8859-1"); 47 - _decoder = new IrcTokens.StatefulDecoder {Encoding = iso8859}; 47 + _decoder = new IRCTokens.StatefulDecoder {Encoding = iso8859}; 48 48 var bytes = iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"); 49 49 var lines = _decoder.Push(bytes, bytes.Length); 50 50 var line = new Line("PRIVMSG #channel :hello Ç"); ··· 55 55 public void TestEncodingFallback() 56 56 { 57 57 var latin1 = Encoding.GetEncoding("iso-8859-1"); 58 - _decoder = new IrcTokens.StatefulDecoder {Encoding = null, Fallback = latin1}; 58 + _decoder = new IRCTokens.StatefulDecoder {Encoding = null, Fallback = latin1}; 59 59 var bytes = latin1.GetBytes("PRIVMSG #channel hélló\r\n"); 60 60 var lines = _decoder.Push(bytes, bytes.Length); 61 61 Assert.AreEqual(1, lines.Count);
+4 -4
IrcTokens/Tests/StatefulEncoder.cs IRCTokens/Tests/StatefulEncoder.cs
··· 1 1 using System.Text; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcTokens.Tests 4 + namespace IRCTokens.Tests 5 5 { 6 6 [TestClass] 7 7 public class StatefulEncoder 8 8 { 9 - private IrcTokens.StatefulEncoder _encoder; 9 + private IRCTokens.StatefulEncoder _encoder; 10 10 11 11 [TestInitialize] 12 12 public void TestInitialize() 13 13 { 14 - _encoder = new IrcTokens.StatefulEncoder(); 14 + _encoder = new IRCTokens.StatefulEncoder(); 15 15 } 16 16 17 17 [TestMethod] ··· 76 76 public void TestEncoding() 77 77 { 78 78 var iso8859 = Encoding.GetEncoding("iso-8859-1"); 79 - _encoder = new IrcTokens.StatefulEncoder {Encoding = iso8859}; 79 + _encoder = new IRCTokens.StatefulEncoder {Encoding = iso8859}; 80 80 _encoder.Push(new Line("PRIVMSG #channel :hello Ç")); 81 81 CollectionAssert.AreEqual(iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"), _encoder.PendingBytes); 82 82 }
+1 -1
IrcTokens/Tests/Tokenization.cs IRCTokens/Tests/Tokenization.cs
··· 1 1 using System.Collections.Generic; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 3 4 - namespace IrcTokens.Tests 4 + namespace IRCTokens.Tests 5 5 { 6 6 [TestClass] 7 7 public class Tokenization
+1 -1
README.md
··· 1 - # IrcSharp 1 + # IRCSharp 2 2 3 3 [![Build Status](https://drone.tildegit.org/api/badges/ben/ircsharp/status.svg)](https://drone.tildegit.org/ben/ircsharp) 4 4