Ejemplo n.º 1
0
        /// <summary>
        /// Gets the menu structure.
        /// </summary>
        /// <returns></returns>
        public DataContract.MenuStructureList GetMenuStructure()
        {
            try
              {
             IMenuStructureLoader loader = new XmlMenuStructureLoader(
             EnvironmentHelper.ExecutionDirectory + ConfigurationHelper.TeletextStructureDefinition,
             EnvironmentHelper.ExecutionDirectory + ConfigurationHelper.TeletextStructureSchema,
             ConfigurationHelper.TeletextStructureSchemaNamespace
             );

              return loader.LoadMenuStructures();
              }
              catch (Exception ex)
              {
            FaultContract fault = new FaultContract();
            throw new FaultException<FaultContract>(fault, new FaultReason(ex.Message));
              }
        }
 public void LoadMenuStructuresTest()
 {
     string teletextStructureXml = XmlFile;
     string teletextStructureSchema = XmlSchemaFile;
     string teletextStructureSchemaNamespace = XmlNamespace;
     XmlMenuStructureLoader target = new XmlMenuStructureLoader(teletextStructureXml, teletextStructureSchema, teletextStructureSchemaNamespace);
     MenuStructureList expected = MenuStructureList;
     MenuStructureList actual;
     actual = target.LoadMenuStructures();
     Assert.AreEqual(expected, actual);
 }