about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-06 02:24:42 -0400
committerBen Harris <ben@tilde.team>2020-05-06 02:24:42 -0400
commit7c482d8cd99b59bbbecf636b797e9e7fec652514 (patch)
tree3330a353472ce3d4c0f1f9af1351bd30074ed2bb
parentaabf66382b7f1041b11241555af33634882f190c (diff)
keep adding more tests
-rw-r--r--IrcStates/Tests/Mode.cs97
-rw-r--r--IrcStates/Tests/Sasl.cs38
-rw-r--r--IrcStates/Tests/User.cs111
3 files changed, 244 insertions, 2 deletions
diff --git a/IrcStates/Tests/Mode.cs b/IrcStates/Tests/Mode.cs
index e7b70f4..98c6aaf 100644
--- a/IrcStates/Tests/Mode.cs
+++ b/IrcStates/Tests/Mode.cs
@@ -1,9 +1,104 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Collections.Generic;
+using IrcTokens;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
 
 namespace IrcStates.Tests
 {
     [TestClass]
     public class Mode
     {
+        private Server _server;
+
+        [TestInitialize]
+        public void TestInitialize()
+        {
+            _server = new Server("test");
+            _server.ParseTokens(new Line("001 nickname"));
+        }
+
+        [TestMethod]
+        public void UModeAdd()
+        {
+            _server.ParseTokens(new Line("MODE nickname +i"));
+            CollectionAssert.AreEqual(new List<string> {"i"}, _server.Modes);
+        }
+
+        [TestMethod]
+        public void UModeRemove()
+        {
+            _server.ParseTokens(new Line("MODE nickname +i"));
+            _server.ParseTokens(new Line("MODE nickname -i"));
+            CollectionAssert.AreEqual(new List<string>(), _server.Modes);
+        }
+
+        [TestMethod]
+        public void PrefixAdd()
+        {
+        }
+
+        [TestMethod]
+        public void PrefixRemove()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelListAdd()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelListRemove()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeBAdd()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeBRemove()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeCAdd()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeCRemove()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeDAdd()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelTypeDRemove()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelNumeric()
+        {
+        }
+
+        [TestMethod]
+        public void ChannelNumericWithoutPlus()
+        {
+        }
+
+        [TestMethod]
+        public void UserNumeric()
+        {
+        }
+
+        [TestMethod]
+        public void UserNumericWithoutPlus()
+        {
+        }
     }
 }
diff --git a/IrcStates/Tests/Sasl.cs b/IrcStates/Tests/Sasl.cs
new file mode 100644
index 0000000..1f38358
--- /dev/null
+++ b/IrcStates/Tests/Sasl.cs
@@ -0,0 +1,38 @@
+using IrcTokens;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace IrcStates.Tests
+{
+    [TestClass]
+    public class Sasl
+    {
+        private Server _server;
+
+        [TestInitialize]
+        public void TestInitialize()
+        {
+            _server = new Server("test");
+            _server.ParseTokens(new Line("900 * nick!user@host account"));
+        }
+
+        [TestMethod]
+        public void LoggedIn()
+        {
+            Assert.AreEqual("nick", _server.NickName);
+            Assert.AreEqual("user", _server.UserName);
+            Assert.AreEqual("host", _server.HostName);
+            Assert.AreEqual("account", _server.Account);
+        }
+
+        [TestMethod]
+        public void LoggedOut()
+        {
+            _server.ParseTokens(new Line("901 * nick1!user1@host1"));
+
+            Assert.AreEqual("nick1", _server.NickName);
+            Assert.AreEqual("user1", _server.UserName);
+            Assert.AreEqual("host1", _server.HostName);
+            Assert.IsTrue(string.IsNullOrEmpty(_server.Account));
+        }
+    }
+}
diff --git a/IrcStates/Tests/User.cs b/IrcStates/Tests/User.cs
index 540d31f..799ab75 100644
--- a/IrcStates/Tests/User.cs
+++ b/IrcStates/Tests/User.cs
@@ -1,9 +1,118 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using IrcTokens;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
 
 namespace IrcStates.Tests
 {
     [TestClass]
     public class User
     {
+        private Server _server;
+
+        [TestInitialize]
+        public void TestInitialize()
+        {
+            _server = new Server("test");
+            _server.ParseTokens(new Line("001 nickname"));
+        }
+
+        [TestMethod]
+        public void NicknameChange()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskJoinBoth()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskJoinUser()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskJoinHost()
+        {
+        }
+
+        [TestMethod]
+        public void ExtendedJoinWithoutExtendedJoin()
+        {
+        }
+
+        [TestMethod]
+        public void ExtendedJoinWithAccount()
+        {
+        }
+
+        [TestMethod]
+        public void ExtendedJoinWithoutAccount()
+        {
+        }
+
+        [TestMethod]
+        public void AccountNotifyWithAccount()
+        {
+        }
+
+        [TestMethod]
+        public void AccountNotifyWithoutAccount()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskPrivmsgBoth()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskPrivmsgUser()
+        {
+        }
+
+        [TestMethod]
+        public void HostmaskPrivmsgHost()
+        {
+        }
+
+        [TestMethod]
+        public void VisibleHostWithoutUsername()
+        {
+        }
+
+        [TestMethod]
+        public void VisibleHostWithUsername()
+        {
+        }
+
+        [TestMethod]
+        public void Who()
+        {
+        }
+
+        [TestMethod]
+        public void Chghost()
+        {
+        }
+
+        [TestMethod]
+        public void Whois()
+        {
+        }
+
+        [TestMethod]
+        public void AwaySet()
+        {
+        }
+
+        [TestMethod]
+        public void AwayUnset()
+        {
+        }
+
+        [TestMethod]
+        public void Setname()
+        {
+        }
     }
 }