/// <summary> /// Assert that value for configuration/appSettings key matches RegEx pattern. /// </summary> /// <param name="xmlTester"><see cref="XmlTester"/>.</param> /// <param name="key">The appSettings key.</param> /// <param name="regExPattern">The RegEx pattern.</param> /// <exception cref="XmlTesterException">if element not found, attribute not found, or value does not match.</exception> public static void AssertAppSettingsValueMatch(this XmlTester xmlTester, string key, string regExPattern) { xmlTester.AssertAttributeValueMatch(ConfigXPath.AppSettingForKey(key), "value", regExPattern); }
/// <summary> /// Assert that specified configuration/appSettings key doesn't exist. /// </summary> /// <param name="xmlTester">The <see cref="XmlTester"/></param> /// <param name="key">The key.</param> /// <exception cref="XmlTesterException">if key is found.</exception> public static void AssertAppSettingsKeyDoesNotExist(this XmlTester xmlTester, string key) { xmlTester.AssertElementDoesNotExist(ConfigXPath.AppSettingForKey(key)); }
/// <summary> /// Assert expected value for configuration/appSettings key. /// </summary> /// <param name="xmlTester"><see cref="XmlTester"/>.</param> /// <param name="key">The appSettings key.</param> /// <param name="expectedValue">The expected value.</param> /// <exception cref="XmlTesterException">if element not found, attribute not found, or value does not match.</exception> public static void AssertAppSettingsValue(this XmlTester xmlTester, string key, string expectedValue) { xmlTester.AssertAttributeValue(ConfigXPath.AppSettingForKey(key), "value", expectedValue); }
/// <summary> /// Get <see cref="XElement"/> for "appSettings" key. /// </summary> /// <param name="xmlTester"><see cref="XmlTester"/>.</param> /// <param name="key">The key.</param> /// <returns>The <see cref="XElement"/>.</returns> public static XElement GetAppSettingsElement(this XmlTester xmlTester, string key) { return(xmlTester.AssertElementExists(ConfigXPath.AppSettingForKey(key))); }