Ejemplo 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);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            var hostsFilenameAbs =
                $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}{@"\TestResources\hosts"}";

            _testObject =
                new WindowsHostsFile(
                    hostsFilenameAbs,
                    "### Test Section",
                    "###");
        }
Ejemplo 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);
        }