示例#1
0
        public void ClearCache()
        {
            try
            {
                SSOSettingsManager.DeleteApp(AppName);
            }
            catch { }

            try
            {
                SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators");

                SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings);

                string value1 = SSOSettingsFileReader.ReadString(AppName, "StringValue");
                SSOSettingsManager.WriteSetting(AppName, "StringValue", "TestValue");
                string value2 = SSOSettingsFileReader.ReadString(AppName, "StringValue");

                Assert.IsTrue(string.Compare(value1, value2, true) == 0);

                SSOSettingsFileReader.ClearCache(AppName);
                string value3 = SSOSettingsFileReader.ReadString(AppName, "StringValue");

                Assert.IsTrue(string.Compare(value3, value2, true) != 0);
            }
            finally
            {
                SSOSettingsManager.DeleteApp(AppName);
            }
        }
示例#2
0
        public void WriteSettings()
        {
            try
            {
                SSOSettingsManager.DeleteApp(AppName);
            }
            catch {}

            try
            {
                SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators");

                SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings);

                for (int x = 0; x < 50; x++)
                {
                    SSOSettingsManager.WriteSetting(AppName, "TestProperty" + x.ToString(), "TestValue" + x.ToString());
                    Console.WriteLine("Wrote setting " + "TestProperty" + x.ToString());
                }

                Hashtable settings = SSOSettingsManager.GetSettings(AppName, false);

                Assert.IsTrue(string.Compare("TestValue0", settings["TestProperty0"].ToString(), true) == 0);
            }
            finally
            {
                SSOSettingsManager.DeleteApp(AppName);
            }
        }