IRC parsing, tokenization, and state handling in C#

keep adding more tests

+244 -2
+96 -1
IrcStates/Tests/Mode.cs
··· 1 - using Microsoft.VisualStudio.TestTools.UnitTesting; 1 + using System.Collections.Generic; 2 + using IrcTokens; 3 + using Microsoft.VisualStudio.TestTools.UnitTesting; 2 4 3 5 namespace IrcStates.Tests 4 6 { 5 7 [TestClass] 6 8 public class Mode 7 9 { 10 + private Server _server; 11 + 12 + [TestInitialize] 13 + public void TestInitialize() 14 + { 15 + _server = new Server("test"); 16 + _server.ParseTokens(new Line("001 nickname")); 17 + } 18 + 19 + [TestMethod] 20 + public void UModeAdd() 21 + { 22 + _server.ParseTokens(new Line("MODE nickname +i")); 23 + CollectionAssert.AreEqual(new List<string> {"i"}, _server.Modes); 24 + } 25 + 26 + [TestMethod] 27 + public void UModeRemove() 28 + { 29 + _server.ParseTokens(new Line("MODE nickname +i")); 30 + _server.ParseTokens(new Line("MODE nickname -i")); 31 + CollectionAssert.AreEqual(new List<string>(), _server.Modes); 32 + } 33 + 34 + [TestMethod] 35 + public void PrefixAdd() 36 + { 37 + } 38 + 39 + [TestMethod] 40 + public void PrefixRemove() 41 + { 42 + } 43 + 44 + [TestMethod] 45 + public void ChannelListAdd() 46 + { 47 + } 48 + 49 + [TestMethod] 50 + public void ChannelListRemove() 51 + { 52 + } 53 + 54 + [TestMethod] 55 + public void ChannelTypeBAdd() 56 + { 57 + } 58 + 59 + [TestMethod] 60 + public void ChannelTypeBRemove() 61 + { 62 + } 63 + 64 + [TestMethod] 65 + public void ChannelTypeCAdd() 66 + { 67 + } 68 + 69 + [TestMethod] 70 + public void ChannelTypeCRemove() 71 + { 72 + } 73 + 74 + [TestMethod] 75 + public void ChannelTypeDAdd() 76 + { 77 + } 78 + 79 + [TestMethod] 80 + public void ChannelTypeDRemove() 81 + { 82 + } 83 + 84 + [TestMethod] 85 + public void ChannelNumeric() 86 + { 87 + } 88 + 89 + [TestMethod] 90 + public void ChannelNumericWithoutPlus() 91 + { 92 + } 93 + 94 + [TestMethod] 95 + public void UserNumeric() 96 + { 97 + } 98 + 99 + [TestMethod] 100 + public void UserNumericWithoutPlus() 101 + { 102 + } 8 103 } 9 104 }
+38
IrcStates/Tests/Sasl.cs
··· 1 + using IrcTokens; 2 + using Microsoft.VisualStudio.TestTools.UnitTesting; 3 + 4 + namespace IrcStates.Tests 5 + { 6 + [TestClass] 7 + public class Sasl 8 + { 9 + private Server _server; 10 + 11 + [TestInitialize] 12 + public void TestInitialize() 13 + { 14 + _server = new Server("test"); 15 + _server.ParseTokens(new Line("900 * nick!user@host account")); 16 + } 17 + 18 + [TestMethod] 19 + public void LoggedIn() 20 + { 21 + Assert.AreEqual("nick", _server.NickName); 22 + Assert.AreEqual("user", _server.UserName); 23 + Assert.AreEqual("host", _server.HostName); 24 + Assert.AreEqual("account", _server.Account); 25 + } 26 + 27 + [TestMethod] 28 + public void LoggedOut() 29 + { 30 + _server.ParseTokens(new Line("901 * nick1!user1@host1")); 31 + 32 + Assert.AreEqual("nick1", _server.NickName); 33 + Assert.AreEqual("user1", _server.UserName); 34 + Assert.AreEqual("host1", _server.HostName); 35 + Assert.IsTrue(string.IsNullOrEmpty(_server.Account)); 36 + } 37 + } 38 + }
+110 -1
IrcStates/Tests/User.cs
··· 1 - using Microsoft.VisualStudio.TestTools.UnitTesting; 1 + using IrcTokens; 2 + using Microsoft.VisualStudio.TestTools.UnitTesting; 2 3 3 4 namespace IrcStates.Tests 4 5 { 5 6 [TestClass] 6 7 public class User 7 8 { 9 + private Server _server; 10 + 11 + [TestInitialize] 12 + public void TestInitialize() 13 + { 14 + _server = new Server("test"); 15 + _server.ParseTokens(new Line("001 nickname")); 16 + } 17 + 18 + [TestMethod] 19 + public void NicknameChange() 20 + { 21 + } 22 + 23 + [TestMethod] 24 + public void HostmaskJoinBoth() 25 + { 26 + } 27 + 28 + [TestMethod] 29 + public void HostmaskJoinUser() 30 + { 31 + } 32 + 33 + [TestMethod] 34 + public void HostmaskJoinHost() 35 + { 36 + } 37 + 38 + [TestMethod] 39 + public void ExtendedJoinWithoutExtendedJoin() 40 + { 41 + } 42 + 43 + [TestMethod] 44 + public void ExtendedJoinWithAccount() 45 + { 46 + } 47 + 48 + [TestMethod] 49 + public void ExtendedJoinWithoutAccount() 50 + { 51 + } 52 + 53 + [TestMethod] 54 + public void AccountNotifyWithAccount() 55 + { 56 + } 57 + 58 + [TestMethod] 59 + public void AccountNotifyWithoutAccount() 60 + { 61 + } 62 + 63 + [TestMethod] 64 + public void HostmaskPrivmsgBoth() 65 + { 66 + } 67 + 68 + [TestMethod] 69 + public void HostmaskPrivmsgUser() 70 + { 71 + } 72 + 73 + [TestMethod] 74 + public void HostmaskPrivmsgHost() 75 + { 76 + } 77 + 78 + [TestMethod] 79 + public void VisibleHostWithoutUsername() 80 + { 81 + } 82 + 83 + [TestMethod] 84 + public void VisibleHostWithUsername() 85 + { 86 + } 87 + 88 + [TestMethod] 89 + public void Who() 90 + { 91 + } 92 + 93 + [TestMethod] 94 + public void Chghost() 95 + { 96 + } 97 + 98 + [TestMethod] 99 + public void Whois() 100 + { 101 + } 102 + 103 + [TestMethod] 104 + public void AwaySet() 105 + { 106 + } 107 + 108 + [TestMethod] 109 + public void AwayUnset() 110 + { 111 + } 112 + 113 + [TestMethod] 114 + public void Setname() 115 + { 116 + } 8 117 } 9 118 }