public void TestReadXmlResourcesStandardActions() { XPathDocument xmlDoc = new XPathDocument(TestResourceHelper.RESOURCES_STANDARD); XmlResourceReader reader = new XmlResourceReader(); IResourceActions resourceActions = reader.ReadXml(xmlDoc); // Check the results Assert.IsTrue(resourceActions.Count == 7, "Should be 7 actions in the standard resources"); }
public void TestReadNoActions() { // Read a resources XML that only has conditions etc. XPathDocument xmlDoc = new XPathDocument(TestResourceHelper.RESOURCES_NO_ACTIONS); XmlResourceReader reader = new XmlResourceReader(); IResourceActions resourceActions = reader.ReadXml(xmlDoc); // The read should work but there shouldn't be any actions returned Assert.IsTrue(resourceActions.Count == 0, "Should be any actions in the standard resources"); }
public void ReadSingleAction() { XPathDocument xmlDoc = new XPathDocument(TestResourceHelper.SINGLE_ACTION_RESOURCE_FILE); XmlResourceReader reader = new XmlResourceReader(); IResourceActions resourceActions = reader.ReadXml(xmlDoc); Assert.AreEqual(1, resourceActions.Count, "Should be only one action in the resources"); foreach (ResourceAction rAction in resourceActions) { Assert.IsTrue(rAction.SupportedFileCollectionCapabilities.Supports(".email"), "This action should support email"); } }
private void Initialize(string resourceXml) { m_xmlDoc = new XmlDocument(); m_resourceActions = new ResourceActions(); m_resourceWriter = new XmlResourceWriter(m_xmlDoc); m_resourceReader = new XmlResourceReader(); m_systemProperties = new SystemProperties(); if (string.IsNullOrEmpty(resourceXml)) { resourceXml = Properties.Resources.XML_RESOURCES_DEFAULT; } if (string.IsNullOrEmpty(m_propertyText)) { m_propertyText = Properties.Resources.XML_PROPERTIES_DEFAULT; } m_xmlDoc.LoadXml(resourceXml); m_resourceActions = m_resourceReader.ReadXml(m_xmlDoc); }