private EnvironmentSettingsCollection GetIsolatedEnvironmentSettingsCollection()
        {
            SecureSettingSource = new TestSource();
            _setting            = Isolate.Fake.Instance <ISetting>();
            Isolate.WhenCalled(() => SecureSettingSource.Add(_setting)).CallOriginal();

            var col = new EnvironmentSettingsCollection(SecureSettingSource);

            return(col);
        }
        public void TurnTheSettingNameInMachineEnvironmentNameAndProvider()
        {
            var source      = new TestSource();
            var settingname = "TestMachine.TestEnvironment.Test.MyProvider";

            source.Add(SettingFactory.CreateSecureSetting(new ConnectionStringSettings(settingname, string.Empty)));
            var col = new EnvironmentSettingsCollection(source);

            Assert.AreEqual("MyProvider", col.Single(s => s.Name == "Test").Provider);
        }
        public EnvironmentSettingsCollection GetIsolatedEnvironmentSettingsCollectionWithSettings()
        {
            SecureSettingSource = new TestSource();
            SecureSettingSource.Add(SettingFactory.CreateSecureSetting <ConnectionStringSettings>("MyMachine.TestEnvironment.Database.SqlProvider", "Connection string to database"));
            //SettingSource.Add(new Setting("MyMachine.TestEnvironment.Database.SqlProvider", "Connection string to database", "Conn", false));
            //SettingSource.Add(new Setting("MyMachine.TestEnvironment.LogPath.FileSystem", "Path to logp", "Conn", false));
            //SettingSource.Add(new Setting("MyMachine.TestEnvironment.ExportPath.FileSystem", "Path to export", "Conn", false));

            //SettingSource.Add(new Setting("OtherMachine.OtherEnvironment.Database.SqlProvider", "Connection string to database", "Conn", false));
            //SettingSource.Add(new Setting("OtherMachine.OtherEnvironment.LogPath.FileSystem", "Path to logp", "Conn", false));
            //SettingSource.Add(new Setting("OtherMachine.OtherEnvironment.ExportPath.FileSystem", "Path to export", "Conn", false));

            KeyManager = Isolate.Fake.Instance <SecretKeyManager>();
            Isolate.WhenCalled(() => KeyManager.GetKey()).WillReturn("secretkey");

            CryptoGraphy = new CryptographyAdapter(new SymCryptography());

            var col = new EnvironmentSettingsCollection(SecureSettingSource);

            return(col);
        }