static int Main(string[] args) { var xmlFile = args.Length == 1 ? args[0] : "Cradiator.exe.config"; if (!File.Exists(xmlFile)) { Console.WriteLine("xml config file doesn't exist: '{0}'", xmlFile); return 1; } var migrate = new MultiviewMigrator(xmlFile); var returnVal = migrate.Migrate(); return string.IsNullOrEmpty(returnVal) ? 0 : 1; }
static int Main(string[] args) { var xmlFile = args.Length == 1 ? args[0] : "Cradiator.exe.config"; if (!File.Exists(xmlFile)) { Console.WriteLine("xml config file doesn't exist: '{0}'", xmlFile); return(1); } var migrate = new MultiviewMigrator(xmlFile); var returnVal = migrate.Migrate(); return(string.IsNullOrEmpty(returnVal) ? 0 : 1); }
public void can_migrate() { var migrate = new MultiviewMigrator(PRE_MULTIVIEW_XML); var updatedXml = migrate.Migrate(); var strippedXml = Regex.Replace(updatedXml, @"[\r\n\t\s]", ""); const string expected = @"<configuration> <configSections> <section name=""log4net"" type=""log4net.Config.Log4NetConfigurationSectionHandler, log4net""/> <section name=""usernames"" type=""System.Configuration.NameValueSectionHandler""/> <section name=""views"" type=""System.Configuration.IgnoreSectionHandler""/> </configSections> <views> <view url=""debughttp://ccnetlive.thoughtworks.com/ccnet"" skin=""StackPhoto"" project-regex="".*"" category-regex="".*"" /> </views>"; var strippedExpected = Regex.Replace(expected, @"[\r\n\t\s]", ""); Assert.That(strippedXml, Is.StringStarting(strippedExpected)); }