예제 #1
0
        public void UnbanComputerTest()
        {
            //Create computers with fake ip-address;
            Computer computer1 = new Computer {
                Banned = false, IpAddress = "999.999.999.997"
            };
            Computer computer2 = new Computer {
                Banned = true, IpAddress = "888.888.888.888"
            };


            BanStorage.CreateComputer(computer1);
            BanStorage.CreateComputer(computer2);

            BanStorage.BanComputer(computer1);

            BanStorage.UnbanComputer(computer1);

            Assert.False(computer1.Banned);

            //Check if computer was marked as unbaned in BanStorage;
            Assert.False(BanStorage.GetComputers().First(c => c.IpAddress == computer1.IpAddress).Banned);

            BanStorage.UnbanComputer(computer2);

            Assert.False(computer2.Banned);
        }