Example #1
0
 public void ChannelTextIs(string testc, string ExpectedValue)
 {
     lock (parseLock)
     {
         bool isTested = false;
         Proxy.ProcessServerChannelData += (sender, Args) =>
         {
             if (!isTested && sender is ChannelObject ServeObject)
             {
                 isTested = true;
                 Assert.That(ServeObject.Player.Message,
                             Is.EqualTo(ExpectedValue),
                             $"Player.Message '{ServeObject.Player.Message}' ExpectedValue: {ExpectedValue}"
                             );
             }
         };
         Proxy.ParseServerChannel(testc, false);
         Proxy.ProcessServerChannelData -= (sender, Args) =>
         {
             if (!isTested && sender is ChannelObject ServeObject)
             {
                 isTested = true;
                 Assert.That(ServeObject.Player.Message,
                             Is.EqualTo(ExpectedValue),
                             $"Player.Message '{ServeObject.Player.Message}' ExpectedValue: {ExpectedValue}"
                             );
             }
         };
         Logger.Debug($"ServerStatus: {Proxy.ServerStatus}");
         Logger.Debug($"ClientStatus: {Proxy.ClientStatus}");
     }
 }
Example #2
0
        public void ChannelTextIs(string testc, string ExpectedValue)
        {
            Proxy.ProcessServerChannelData += (sender, Args) =>
            {
                if (sender is ChannelObject ServeObject)
                {
                    Assert.That(ServeObject.Player.Message.Trim(),
                                Is.EqualTo(ExpectedValue.Trim()));
                }
            };

            Proxy.ParseServerChannel(testc, false);

            Proxy.ProcessServerChannelData -= (sender, Args) =>
            {
                if (sender is ChannelObject ServeObject)
                {
                    Assert.That(ServeObject.Player.Message.Trim(),
                                Is.EqualTo(ExpectedValue.Trim()));
                }
            };
        }
        public void ChannelIsQueryOfType(string ChannelCode, QueryType ExpectedValue, string ExpectedName)
        {
            lock (qLock)
            {
                bool isTested = false;
                Proxy.ProcessServerChannelData += (sender, Args) =>
                {
                    if (!isTested && sender is QueryChannelObject queryObject)
                    {
                        isTested = true;
                        Assert.Multiple(() =>
                        {
                            Assert.That(queryObject.Query,
                                        Is.EqualTo(ExpectedValue), queryObject.ToString());
                            Assert.That(queryObject.Player.ShortName,
                                        Is.EqualTo(ExpectedName.ToFurcadiaShortName()), queryObject.ToString());
                        });
                    }
                };

                Proxy.ParseServerChannel(ChannelCode, false);

                Proxy.ProcessServerChannelData -= (sender, Args) =>
                {
                    if (!isTested && sender is QueryChannelObject queryObject)
                    {
                        isTested = true;
                        Assert.Multiple(() =>
                        {
                            Assert.That(queryObject.Query,
                                        Is.EqualTo(ExpectedValue), queryObject.ToString());
                            Assert.That(queryObject.Player.ShortName,
                                        Is.EqualTo(ExpectedName.ToFurcadiaShortName()), queryObject.ToString());
                        });
                    }
                };
            }
        }