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); } }
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); } }
public void WriteRawSettings() { try { SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators"); SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings); string settings = SSOSettingsManager.GetRawSettings(AppName, false); Assert.IsTrue(string.Compare(DefaultSettings, settings, true) == 0); } finally { SSOSettingsManager.DeleteApp(AppName); } }
public void ReadInvalid() { try { SSOSettingsManager.DeleteApp(AppName); } catch { } try { SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators"); SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings); SSOSettingsFileReader.ReadString(AppName, "NoValue"); } finally { SSOSettingsManager.DeleteApp(AppName); } }
public void ReadAll() { try { SSOSettingsManager.DeleteApp(AppName); } catch { } try { SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators"); SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings); Hashtable values = SSOSettingsFileReader.Read(AppName); Assert.IsTrue(values.Count == 4); } finally { SSOSettingsManager.DeleteApp(AppName); } }
public void ReadInt32() { try { SSOSettingsManager.DeleteApp(AppName); } catch { } try { SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators"); SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings); int value = SSOSettingsFileReader.ReadInt32(AppName, "Int32Value"); Assert.AreEqual(100, value); } finally { SSOSettingsManager.DeleteApp(AppName); } }
public void ReadString() { try { SSOSettingsManager.DeleteApp(AppName); } catch { } try { SSOSettingsManager.CreateApp(AppName, "BizTalk Application Users", "BizTalk Server Administrators"); SSOSettingsManager.WriteRawSettings(AppName, DefaultSettings); string value = SSOSettingsFileReader.ReadString(AppName, "StringValue"); Assert.IsTrue(string.Compare(@"BizTalkSample", value, true) == 0); } finally { SSOSettingsManager.DeleteApp(AppName); } }