Esempio n. 1
0
        public void ShouldFindDefaultForNoMatches()
        {
            var file  = PgPassFile.Load(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("notarealhost");

            Assert.That(entry.Password, Is.EqualTo("defaultpass"));
        }
Esempio n. 2
0
        public void ShouldFindFirstEntryWhenMultipleMatch()
        {
            var file  = PgPassFile.Load(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("testhost");

            Assert.That(entry.Password, Is.EqualTo("testpass"));
        }
Esempio n. 3
0
        public void ShouldParseAllEntries()
        {
            var file    = PgPassFile.Load(_pgpassFile);
            var entries = file.Entries.ToList();

            Assert.That(entries.Count, Is.EqualTo(3));
        }
Esempio n. 4
0
        public void Should_find_default_for_no_matches()
        {
            var file  = new PgPassFile(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("notarealhost") !;

            Assert.That(entry.Password, Is.EqualTo("defaultpass"));
        }
Esempio n. 5
0
        public void Should_find_first_entry_when_multiple_match()
        {
            var file  = new PgPassFile(_pgpassFile);
            var entry = file.GetFirstMatchingEntry("testhost") !;

            Assert.That(entry.Password, Is.EqualTo("testpass"));
        }
Esempio n. 6
0
        public void Should_parse_all_entries()
        {
            var file    = new PgPassFile(_pgpassFile);
            var entries = file.Entries.ToList();

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