Inheritance: IDisposable
Example #1
0
        public void TestCleanup()
        {
            if (_bootstrapper != null) {
                _bootstrapper.Dispose();
                _bootstrapper = null;
            }

            if (ws != null) {
                ws.Close();
                ws = null;
            }
        }
Example #2
0
        public void TestSetup()
        {
            _bootstrapper = new Bootstrapper(log4net.LogManager.GetLogger(typeof(RegisterTest)));
            ws = new WebSocket("ws://localhost:2345/IdleLands");
            ws.Log.Level = LogLevel.Trace;

            ResetResponse();

            ws.OnMessage += (sender, e) => {
                Console.WriteLine("Response: " + e.Data);

                if(string.IsNullOrEmpty(e.Data))
                {
                    correct = false;
                    return;
                }

                response = JsonConvert.DeserializeObject<ResponseMessage>(e.Data);

                if(response == null)
                {
                    correct = false;
                    return;
                }
                correct = true;
            };

            ws.Connect();
        }