Permalink
Browse files

Added Raven dal test.

  • Loading branch information...
1 parent 57b5f3e commit 97f362ca6c31c239b469060fa0f20cf0306710e7 @mslot committed Sep 10, 2012
Showing with 93 additions and 0 deletions.
  1. +92 −0 UnitTest/RavelDalTest/AddQueryTest.cs
  2. +1 −0 UnitTest/UnitTest.csproj
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+
+namespace UnitTest.RavelDalTest
+{
+ [TestFixture]
+ class AddQueryTest
+ {
+ public IEnumerable<IRCSharp.Kernel.Model.Query.IRCCommandQuery> GenerateQueries()
+ {
+ LinkedList<IRCSharp.Kernel.Model.Query.IRCCommandQuery> queries = new LinkedList<IRCSharp.Kernel.Model.Query.IRCCommandQuery>();
+ List<string> rawQueries = new List<string> {
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot1!~mslot1@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #mslot.dk :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot2!~mslot2@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #c :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #r :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot3!~mslot3@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #lol :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #3 :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #3 :!command arg1 arg2 arg3",
+ ":mslot4!~mslot4@56344eba.rev.stofanet.dk PRIVMSG #3 :!command arg1 arg2 arg3",
+ ":mslot!~mslot@56344eba.rev.stofanet.dk PRIVMSG #error :!command arg1 arg2 arg3",
+ ":mslot!~mslot@56344eba.rev.stofanet.dk PRIVMSG #error :!command arg1 arg2 arg3",
+ ":mslot!~mslot@56344eba.rev.stofanet.dk PRIVMSG #error :!command arg1 arg2 arg3",
+ ":mslot!~mslot@56344eba.rev.stofanet.dk PRIVMSG #error :!command arg1 arg2 arg3"
+ };
+
+ foreach (string rawQuery in rawQueries)
+ {
+ IRCSharp.Kernel.Model.Query.IRCCommandQuery query = null;
+ bool parsed = IRCSharp.Kernel.Parser.IRC.IRCQueryParser.TryParse(rawQuery, out query);
+ queries.AddLast(query);
+ }
+
+ return queries;
+ }
+
+
+ [Test]
+ public void AddFirstGeneratedQueries()
+ {
+ var generatedQueries = GenerateQueries();
+ IRCSharp.Kernel.Model.Query.IRCCommandQuery firstQuery = generatedQueries.First();
+
+ }
+ }
+}
View
@@ -49,6 +49,7 @@
<Compile Include="IRCParser\IRCParserTest.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RavelDalTest\AddQueryTest.cs" />
<Compile Include="UserdefinedCommand\UserdefinedParserTest.cs" />
</ItemGroup>
<ItemGroup>

0 comments on commit 97f362c

Please sign in to comment.