From aabf66382b7f1041b11241555af33634882f190c Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 6 May 2020 02:04:00 -0400 Subject: add ISUPPORT tests --- IrcStates/ISupportPrefix.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 IrcStates/ISupportPrefix.cs (limited to 'IrcStates/ISupportPrefix.cs') diff --git a/IrcStates/ISupportPrefix.cs b/IrcStates/ISupportPrefix.cs new file mode 100644 index 0000000..94668e3 --- /dev/null +++ b/IrcStates/ISupportPrefix.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace IrcStates +{ + public class ISupportPrefix + { + public ISupportPrefix(string splitVal) + { + var split = splitVal.Substring(1).Split(')', 2); + Modes = new List {split[0]}; + Prefixes = new List {split[1]}; + } + + public List Modes { get; set; } + public List Prefixes { get; set; } + + public string FromMode(string mode) + { + return Modes.Contains(mode) ? Modes[Modes.IndexOf(mode)] : null; + } + + public string FromPrefix(string prefix) + { + return Prefixes.Contains(prefix) ? Prefixes[Prefixes.IndexOf(prefix)] : null; + } + } +} -- cgit 1.4.1