Пример #1
0
        public void ShouldFindFirstEntryWhenMultipleMatch()
        {
            var file  = PgPassFile.Load(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("testhost");

            Assert.That(entry.Password, Is.EqualTo("testpass"));
        }
Пример #2
0
        public void ShouldFindDefaultForNoMatches()
        {
            var file  = PgPassFile.Load(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("notarealhost");

            Assert.That(entry.Password, Is.EqualTo("defaultpass"));
        }
Пример #3
0
        public void ShouldParseAllEntries()
        {
            var file    = PgPassFile.Load(_pgpassFile);
            var entries = file.Entries.ToList();

            Assert.That(entries.Count, Is.EqualTo(3));
        }