示例#1
0
        public void SearchByColorByXml()
        {
            IDataHandler datahandler    = new XMLDataHandler();
            List <Car>   expectedResult = datahandler.SearchByColor("Red");

            Assert.That(expectedResult, Has.Count.EqualTo(4));
        }
示例#2
0
        public void SearchByDriverByXml()
        {
            IDataHandler datahandler    = new XMLDataHandler();
            List <Car>   expectedResult = datahandler.SearchByDriver("Janos");

            Assert.That(expectedResult, Is.Not.Null.And.Not.Empty);
        }
示例#3
0
        private void ReadXml()
        {
            data = new XMLDataHandler();
            string filename = GetFileName("xml");

            if (filename == null)
            {
                return;
            }
            try
            {
                _baseDocument       = data.LoadXML(filename);
                _generatedXDocument = new XDocument(_baseDocument);
            }
            catch (Exception ex)
            {
                SweetAlert.Show("Error while reading file:", ex.Message, msgImage: SweetAlertImage.ERROR);
            }

            _schemaPath = GetFileName("xsd");
            try
            {
                XMLValidator.ValidateSchema("http://www.gamelib.org/types", _schemaPath, _baseDocument);
            }
            catch (Exception ex)
            {
                SweetAlert.Show("XSD Schema validation error:", ex.Message, msgImage: SweetAlertImage.ERROR);
            }

            GameLibrary     = data.GameLibrary;
            BaseGameLibrary = new GameLibrary(GameLibrary);
            UpdateIds();
            RaisePropertyChanged("GamesIds");
        }
示例#4
0
 public void Initialize()
 {
     dataHandlerFactory = new DataHandlerFactory();
     xMLDataHandler     = new XMLDataHandler();
     cSVDataHandler     = new CSVDataHandler();
     dBDataHandler      = new DBDataHandler(new CarDBContext());
 }
    // Use this for initialization
    public void Initialize()
    {
        uiElementsDataFile = "UIElementsData";
        tooltipsDataFile   = "ToolTipsData";
        uiElementsDataPath = "XML\\";
        string currentLocalizationPreset = ReferenceManager.Instance.localizationManagerRef.GetCurrentLocalizationPreset().ToString();

        Debug.Log("UIElementsDataManager::Initialize:currentLocalizationPreset: " + currentLocalizationPreset);
        uiElementsDataPath += currentLocalizationPreset + "\\";
        uiElementsDataFile += "_" + currentLocalizationPreset;
        Debug.Log("UIElementsDataManager::Initialize:uiElementsDataPath: " + uiElementsDataPath);
        xmlDataHandler = new XMLDataHandler();
        xmlDataHandler.loadXMLFromResources(uiElementsDataFile, uiElementsDataPath);

        uiElementToToolTipIDsDict = new Dictionary <string, string>();
        ParseUIElementsData();
        tooltipsDataFile += "_" + currentLocalizationPreset;
        xmlDataHandler.loadXMLFromResources(tooltipsDataFile, uiElementsDataPath);
        toolTipIDToDataDict = new Dictionary <string, ToolTipData>();
        ParseToolTipsData();
    }