Наследование: ConfigurationFactory
Пример #1
0
        protected void SetupSecureSettingSource()
        {
            Configuration = Isolate.Fake.Instance <Configuration>();
            Factory       = new TestConfigurationFactory(Configuration);

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

            CryptoGraphy = Isolate.Fake.Instance <CryptoGraphy>();
            Isolate.WhenCalled(() => CryptoGraphy.SetKey(Key)).IgnoreCall();
            Name      = "secret";
            Encrypted = "[Secure]=";
            Isolate.WhenCalled((() => CryptoGraphy.Encrypt(Name))).WillReturn(Encrypted);
            Isolate.WhenCalled((() => CryptoGraphy.Decrypt(Encrypted))).WillReturn(Name);

            SecureSettingSource = new ConfigurationSettingSource(Factory);
        }
        protected void SetupSecureSettingSource()
        {
            Configuration = Isolate.Fake.Instance<Configuration>();
            Factory = new TestConfigurationFactory(Configuration);

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

            CryptoGraphy = Isolate.Fake.Instance<CryptoGraphy>();
            Isolate.WhenCalled(() => CryptoGraphy.SetKey(Key)).IgnoreCall();
            Name = "secret";
            Encrypted = "[Secure]=";
            Isolate.WhenCalled((() => CryptoGraphy.Encrypt(Name))).WillReturn(Encrypted);
            Isolate.WhenCalled((() => CryptoGraphy.Decrypt(Encrypted))).WillReturn(Name);

            SecureSettingSource = new ConfigurationSettingSource(Factory);
        }