Пример #1
0
            public void will_add_if_entry_not_exists()
            {
                var hostFile = new HostsFile();

                hostFile.Set("127.0.0.1", "test.com");
                Assert.Equal(1, hostFile.AllEntries().Count);
                Assert.Equal("127.0.0.1", hostFile.AllEntries()[0].IP);
                Assert.Equal("test.com", hostFile.AllEntries()[0].Host);
            }
Пример #2
0
 public void will_update_if_entry_already_exists()
 {
     var hostFile = new HostsFile();
     hostFile.Set("127.0.0.1", "test.com");
     hostFile.Set("127.1.1.1", "test.com");
     Assert.Equal(1, hostFile.AllEntries().Count);
     Assert.Equal("127.1.1.1", hostFile.AllEntries()[0].IP);
     Assert.Equal("test.com", hostFile.AllEntries()[0].Host);
 }