Exemplo n.º 1
0
        public void ExtractedCorrectNumberOfHostsFromFileWhenNotFiltered()
        {
            var hostsFilenameAbs =
                $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}{@"\TestResources\hostsTestSectionOnly"}";

            _testObject = new WindowsHostsFile(hostsFilenameAbs);

            Assert.AreEqual(2, _testObject.Hosts.Count);
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            var hostsFilenameAbs =
                $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}{@"\TestResources\hosts"}";

            _testObject =
                new WindowsHostsFile(
                    hostsFilenameAbs,
                    "### Test Section",
                    "###");
        }
Exemplo n.º 3
0
        public void ExtractedCorrectNumberOfHostsFromFileWhenNone()
        {
            var hostsFilenameAbs =
                $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}{@"\TestResources\hostsWithoutTestSection"}";

            _testObject =
                new WindowsHostsFile(
                    hostsFilenameAbs,
                    "### Test Section",
                    "###");

            Assert.AreEqual(0, _testObject.Hosts.Count);
        }