MatchesIgnoringNewlines() публичный статический Метод

public static MatchesIgnoringNewlines ( string hostsFile, string expectedString ) : void
hostsFile string
expectedString string
Результат void
Пример #1
0
        public void can_remove_an_entry()
        {
            string filename = GetFileWithContents(@"
127.0.0.1           localhost
10.90.82.100        somehost

", Encoding.UTF8);

            var sut = new Remove();

            sut.RemoveFromFile("somehost", filename);

            AssertFile.MatchesIgnoringNewlines(filename, @"
127.0.0.1           localhost

");
        }
Пример #2
0
        public void can_remove_by_regex()
        {
            string filename = GetFileWithContents(@"
11.90.82.100        ladeda
127.0.0.1           localhost
10.90.82.100        somehost
11.90.82.100        anotherserver

", Encoding.UTF8);

            var sut = new Remove();

            sut.RemoveFromFile(new Regex(".*host"), filename);

            AssertFile.MatchesIgnoringNewlines(filename, @"
11.90.82.100        ladeda
11.90.82.100        anotherserver

");
        }