Exemplo n.º 1
0
        public void RemoveDisplayBadTest()
        {
            DisplayManagerAppLayer.DisplayManager displayManager = new DisplayManagerAppLayer.DisplayManager();
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));

            Assert.AreEqual(4, displayManager.GetDisplayCount());

            displayManager.RemoveDisplay(7);
            Assert.AreNotEqual(3, displayManager.GetDisplayCount());
            Assert.AreEqual(4, displayManager.GetDisplayCount());
        }
Exemplo n.º 2
0
        public void RemoveDisplayTest()
        {
            DisplayManagerAppLayer.DisplayManager displayManager = new DisplayManagerAppLayer.DisplayManager();
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));
            displayManager.AddDisplay(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 12001));

            Assert.AreEqual(4, displayManager.GetDisplayCount());

            displayManager.RemoveDisplay(3);
            Assert.AreEqual(3, displayManager.GetDisplayCount());

            List <int> list = displayManager.GenerateIdList();

            Assert.AreEqual(1, list[0]);
            Assert.AreEqual(2, list[1]);
            Assert.AreNotEqual(3, list[2]);
            Assert.AreEqual(4, list[2]);
        }