Exemplo 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));
              }
        }
 internal virtual IMenuStructureLoader CreateIMenuStructureLoader()
 {
     IMenuStructureLoader target = new XmlMenuStructureLoader(XmlFile, XmlSchemaFile, XmlNamespace);
     return target;
 }
 public void XmlMenuStructureLoaderConstructorTest()
 {
     string teletextStructureXml = XmlFile;
     string teletextStructureSchema = XmlSchemaFile;
     string teletextStructureSchemaNamespace = XmlNamespace;
     XmlMenuStructureLoader target = new XmlMenuStructureLoader(teletextStructureXml, teletextStructureSchema, teletextStructureSchemaNamespace);
     Assert.IsNotNull(target);
 }
 public void TeletextStructureXmlTest()
 {
     string teletextStructureXml = XmlFile;
     string teletextStructureSchema = XmlSchemaFile;
     string teletextStructureSchemaNamespace = XmlNamespace;
     XmlMenuStructureLoader xmsl = new XmlMenuStructureLoader(teletextStructureXml, teletextStructureSchema, teletextStructureSchemaNamespace);
     PrivateObject param0 = new PrivateObject(xmsl);
     XmlMenuStructureLoader_Accessor target = new XmlMenuStructureLoader_Accessor(param0);
     string expected = XmlFile;
     string actual;
     target.TeletextStructureXml = expected;
     actual = target.TeletextStructureXml;
     Assert.AreEqual(expected, actual);
 }
 public void SetTeletextStructureXmlTest()
 {
     string teletextStructureXml = XmlFile;
     string teletextStructureSchema = XmlSchemaFile;
     string teletextStructureSchemaNamespace = XmlNamespace;
     XmlMenuStructureLoader xmsl = new XmlMenuStructureLoader(teletextStructureXml, teletextStructureSchema, teletextStructureSchemaNamespace);
     PrivateObject param0 = new PrivateObject(xmsl);
     XmlMenuStructureLoader_Accessor target = new XmlMenuStructureLoader_Accessor(param0);
     target.SetTeletextStructureXml(teletextStructureXml, teletextStructureSchema, teletextStructureSchemaNamespace);
     Assert.AreEqual(teletextStructureXml, target.TeletextStructureXml);
 }
 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);
 }