public void TestWhenWCFCallBackIsNotOpen()
        {
            using (var host = new WcfHost())
            {
                Client client = new Client("Roman");
                Thread.Sleep(100);

                var state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Opened, state, "Initial state");

                client.Kill();
                state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Opened, state, "stale state");

                host.instance.PublishToAll("Test");
                Thread.Sleep(300);

                state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Closed, state, "Final state");

                Assert.AreEqual(1, host.ActiveClients, "Active clients should be 1");

                host.instance.PublishToAll("Test");
                Thread.Sleep(300);

                Assert.AreEqual(0, host.ActiveClients, "Active clients should be 0");
            }
        }
        public void TestWhenWCFCallBackIsNotOpen()
        {
            using (var host = new WcfHost())
            {
                Client client = new Client("Roman");
                Thread.Sleep(100);

                var state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Opened, state, "Initial state");

                client.Kill();
                state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Opened, state, "stale state");

                host.instance.PublishToAll("Test");
                Thread.Sleep(300);

                state = host.GetClientChannel().State;
                Assert.AreEqual(CommunicationState.Closed, state, "Final state");

                Assert.AreEqual(1, host.ActiveClients, "Active clients should be 1");

                host.instance.PublishToAll("Test");
                Thread.Sleep(300);

                Assert.AreEqual(0, host.ActiveClients, "Active clients should be 0");

            }
        }