From 7c482d8cd99b59bbbecf636b797e9e7fec652514 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 6 May 2020 02:24:42 -0400 Subject: [PATCH] keep adding more tests --- IrcStates/Tests/Mode.cs | 97 ++++++++++++++++++++++++++++++++++- IrcStates/Tests/Sasl.cs | 38 ++++++++++++++ IrcStates/Tests/User.cs | 111 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 IrcStates/Tests/Sasl.cs 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 {"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(), _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() + { + } } }