HostsFile Load() { using (var stream = GetStream()) { return(HostsFile.Load(stream)); } }
public void Load_LoadsHostsFileFromAStream() { var hostsFile = HostsFile.Load(TestContext.GetResourceStream("FluentInstallation.Web.Hosts.Hosts.txt")); Assert.NotEmpty(hostsFile.AllHostEntries()); Assert.Equal(3, hostsFile.AllHostEntries().Count()); Assert.Equal("This is a comment", hostsFile.AllHostEntries().Last().Description); Assert.NotEmpty(hostsFile.AllComments()); Assert.Equal(2, hostsFile.AllComments().Count()); }