Пример #1
0
        public void HostPwEntryGetAdditionalOptionsAssertDoesNotThrow(String title, String additionalOptionsFieldName)
        {
            var fieldsMapper = new InMemoryFieldMapper()
            {
                HostAddress       = "IP Address",
                ConnectionMethod  = "OS",
                AdditionalOptions = additionalOptionsFieldName
            };

            var entry = new HostPwEntry(
                PwDatabaseUtils.FindEntryByTitle(this.pwDatabase, title, true),
                this.pwDatabase,
                fieldsMapper
                );

            String additionalOptions = null;

            Assert.DoesNotThrow(() => additionalOptions = entry.AdditionalOptions);
            Assert.IsNullOrEmpty(additionalOptions);
        }
Пример #2
0
        public void HostPwEntryGetAdditionalOptionsWithPlaceholders(String title, string expectedAdditionalOptions)
        {
            // Arrange
            var fieldMapper = new InMemoryFieldMapper()
            {
                AdditionalOptions = "Notes"
            };

            // Act
            var entry = new HostPwEntry(
                PwDatabaseUtils.FindEntryByTitle(this.pwDatabase, title, true),
                this.pwDatabase,
                fieldMapper
                );

            // Assert
            String additionalOptions = null;

            Assert.DoesNotThrow(() => additionalOptions = entry.AdditionalOptions);
            Assert.That(additionalOptions, Is.EqualTo(expectedAdditionalOptions));
        }