Exemplo n.º 1
0
        public void TestCreateSubscribeTaskCreate()
        {
            server.ServerQueue.QueueA.Enqueue(new ClientRequestCreate("testQ", "client1"));
            Task testTask = new Task(() => server.CreateSubscribeTask());

            testTask.Start();
            Thread.Sleep(100);  //odspavamo i damo mu sansu da odradi posao

            Assert.AreEqual(server.ServerQueue.QueueB.Count, 1);
            ServerResponseAS serverResponse = (ServerResponseAS)server.ServerQueue.QueueB.Dequeue();

            Assert.AreEqual(serverResponse.UserId, "client1");
            Assert.IsNotNull(serverResponse.Queues);
        }