Exemple #1
0
        public void SecureTest()
        {
            var tddHandler = new TDDHandler();

            const string secureKey   = "v2.secureFoo";
            const string secureValue = "SecureFooStringValue";

            ActionsTestSettings.SecureFooString = secureValue;
            ActionsTestSettings.SaveSettings();

            string loadedSecureValue = ActionsTest.GetSecureStringValue(secureKey);

            Assert.AreEqual(ActionsTestSettings.SecureFooString, loadedSecureValue);
            Assert.AreEqual(secureValue, loadedSecureValue);

            ActionsTestSettings.SecureFooString = null;
            ActionsTestSettings.LoadSettings();
            Assert.AreEqual(ActionsTestSettings.SecureFooString, secureValue);

            ActionsTestSettings.DeleteSettings();
            string loadedNullSecureValue = ActionsTest.GetSecureStringValue(secureKey);

            Assert.IsNull(loadedNullSecureValue);
            Assert.IsNull(ActionsTestSettings.SecureFooString);

            tddHandler.CheckErrors();
        }
Exemple #2
0
        public void LocalTest()
        {
            var tddHandler = new TDDHandler();

            const string key   = "v2.foo";
            const string value = "FooStringValue";

            ActionsTestSettings.LocalFooString = value;
            ActionsTestSettings.SaveSettings();

            string loadedValue = GetLocalStringValue(key);

            Assert.AreEqual(loadedValue, value);

            ActionsTestSettings.LocalFooString = null;
            ActionsTestSettings.LoadSettings();
            Assert.AreEqual(ActionsTestSettings.LocalFooString, value);

            ActionsTestSettings.DeleteSettings();
            string loadedNullNSUserDefaultsValue = GetLocalStringValue(key);

            Assert.IsNull(loadedNullNSUserDefaultsValue);
            Assert.IsNull(ActionsTestSettings.LocalFooString);

            tddHandler.CheckErrors();
        }