public void WillMatchSystemRegular() { const string localPath = @"C:\Users\johns\Desktop\KvG Client 2.0"; if (!Directory.Exists(localPath)) { Debug.WriteLine("Not running test, requires Cliloc.enu"); return; } Cliloc.Initialize(localPath); byte[] packet = { 0xC1, 0x00, 0x32, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x03, 0xB2, 0x00, 0x03, 0x00, 0x07, 0xA4, 0xE1, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; IncomingPacketHandlers.Initialize(); PacketHandler handler = IncomingPacketHandlers.GetHandler(0xc1); Assert.IsNotNull(handler); handler.OnReceive(new PacketReader(packet, packet.Length, false)); Assert.IsTrue(JournalCommands.InJournal("fingers slip!", "system")); }
public void WillMatchSystem() { Engine.Journal.Write(new JournalEntry { Text = "You are now under the protection of town guards.", SpeechType = JournalSpeech.System }); Assert.IsTrue(JournalCommands.InJournal("town guards", "system")); Engine.Journal.Clear(); }
public void WillMatchAuthor() { Engine.Journal.Write(new JournalEntry { Text = "The quick brown bow jumped over the lazy dog.", SpeechType = JournalSpeech.Say, Name = "Tony" }); Assert.IsTrue(JournalCommands.InJournal("lazy dog", "tony")); Engine.Journal.Clear(); }
public void WillClearJournal() { Engine.Journal.Write(new JournalEntry { Text = "The quick brown bow jumped over the lazy dog.", SpeechType = JournalSpeech.Say, Name = "Tony" }); JournalCommands.ClearJournal(); Assert.AreEqual(0, Engine.Journal.Count); Engine.Journal.Clear(); }
public void WillMatchAny() { Engine.Journal.Write(new JournalEntry { Text = "You are now under the protection of town guards.", SpeechType = JournalSpeech.System }); Engine.Journal.Write(new JournalEntry { Text = "The quick brown bow jumped over the lazy dog.", SpeechType = JournalSpeech.Say, Name = "Tony" }); Assert.IsTrue(JournalCommands.InJournal("town guards")); Assert.IsTrue(JournalCommands.InJournal("lazy dog")); Engine.Journal.Clear(); }