示例#1
0
        public bool MigrateIfNecassary()
        {
            var  m = new ConfigurationMigrator();
            bool migrationWasSuccessful = m.MigrateConfigurationXmlIfNeeded(_configFilePath, _configFilePath);

            _xmlDocument.Load(_configFilePath);
            return(migrationWasSuccessful);
        }
        public void DoesMigrateV0File()
        {
            File.WriteAllText(
                _pathToInputConfig,
                "<?xml version='1.0' encoding='utf-8'?><tasks><components><viewTemplate></viewTemplate></components><task id='Dashboard' class='WeSay.LexicalTools.Dashboard.DashboardControl' assembly='CommonTools' default='true'></task></tasks>"
                );
            bool didMigrate = _migrator.MigrateConfigurationXmlIfNeeded(_pathToInputConfig, _outputPath);

            Assert.IsTrue(didMigrate);
            var outputDoc = new XmlDocument();

            outputDoc.Load(_outputPath);
            Assert.IsNotNull(outputDoc.SelectSingleNode(_queryToCheckConfigVersion));
        }