From 933a4f85604e21445c9bac8272d64cf3e6f65e00 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 22 Apr 2020 16:28:51 -0400 Subject: rename to IrcSharp also tidy up formatting with vs tools --- IrcTokens/Tests/ParserTests.cs | 57 ------------------------------------------ 1 file changed, 57 deletions(-) delete mode 100644 IrcTokens/Tests/ParserTests.cs (limited to 'IrcTokens/Tests/ParserTests.cs') diff --git a/IrcTokens/Tests/ParserTests.cs b/IrcTokens/Tests/ParserTests.cs deleted file mode 100644 index ad734cf..0000000 --- a/IrcTokens/Tests/ParserTests.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using IrcTokens.Tests.Data; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace IrcTokens.Tests -{ - [TestClass] - public class ParserTests - { - private static T LoadYaml(string path) - { - var deserializer = new DeserializerBuilder() - .WithNamingConvention(CamelCaseNamingConvention.Instance) - .Build(); - - return deserializer.Deserialize(File.ReadAllText(path)); - } - - [TestMethod] - public void TestSplit() - { - foreach (var test in LoadYaml("Tests/Data/msg-split.yaml").Tests) - { - var tokens = new Line(test.Input); - var atoms = test.Atoms; - - Assert.AreEqual(atoms.Verb.ToUpper(CultureInfo.InvariantCulture), tokens.Command, - $"command failed on: '{test.Input}'"); - Assert.AreEqual(atoms.Source, tokens.Source, $"source failed on: '{test.Input}'"); - CollectionAssert.AreEqual(atoms.Tags, tokens.Tags, $"tags failed on: '{test.Input}'"); - CollectionAssert.AreEqual(atoms.Params ?? new List(), tokens.Params, $"params failed on: '{test.Input}'"); - } - } - - [TestMethod] - public void TestJoin() - { - foreach (var test in LoadYaml("Tests/Data/msg-join.yaml").Tests) - { - var atoms = test.Atoms; - var line = new Line - { - Command = atoms.Verb, - Params = atoms.Params, - Source = atoms.Source ?? null, - Tags = atoms.Tags - }.Format(); - - Assert.IsTrue(test.Matches.Contains(line), test.Description); - } - } - } -} -- cgit 1.4.1