public void Load(string parentPath, string[] expectedChildKeys)
        {
            var provider = new KeePassConfigurationProvider(ConfigurationSource);

            provider.Load();
            var keys = provider.GetChildKeys(new List <string>(), parentPath);

            keys.Should().Contain(expectedChildKeys);
        }
示例#2
0
        public void AddKeePass_MapsKdbxPathToConnection(string path)
        {
            Builder.AddKeePass(path);

            Builder.Sources.Should().NotBeEmpty();
            Builder.Sources.First().Should().BeOfType <KeePassConfigurationSource>();

            var keePassSource = (KeePassConfigurationSource)Builder.Sources.First();

            keePassSource.Path.Should().BeEquivalentTo(path);
            keePassSource.Connection.Path.Should().BeEquivalentTo(path);

            var provider = new KeePassConfigurationProvider(keePassSource);

            provider.Invoking(x => x.Load()).Should().Throw <InvalidCompositeKeyException>();
        }