Exemple #1
0
        public BlockedIPCollectionFixture()
        {
            _file = new Mock <IFile>();

            _file.Setup(f => f.ReadAllLine(It.IsAny <string>())).Returns(new [] { "192.168.0.254", "192.168.0.255" }).Verifiable();

            _blockedIPCollection = new BlockedIPCollection("BlockedIPList.txt", _file.Object);
        }
Exemple #2
0
        public void When_Created_Collection_Should_Contain_The_IpAddress_Of_File()
        {
            _file.Setup(f => f.ReadAllLine(It.IsAny <string>())).Returns(new[] { "192.168.0.1", "192.168.0.2" });

            var collection = new BlockedIPCollection("BlockedIPList.txt", _file.Object);

            Assert.Contains("192.168.0.1", collection);
            Assert.Contains("192.168.0.2", collection);
        }