public async override Task <DeliverableResponse> Run(string command, string[] args)
        {
            string path;

            if (settings.TryGetSiteRootDirectory(out path))
            {
                await Out.WriteLineFormattedAsync("Site root directory: {0}", path);
            }
            else
            {
                await Out.WriteLineAsync("Unable to locate the site root directory");
            }

            if (settings.TryGetUmbracoDirectory(out path))
            {
                await Out.WriteLineFormattedAsync("Umbraco directory: {0}", path);
            }
            else
            {
                await Out.WriteLineAsync("Unable to locate the Umbraco directory");
            }

            if (settings.TryGetChauffeurDirectory(out path))
            {
                await Out.WriteLineFormattedAsync("Chauffeur directory: {0}", path);
            }
            else
            {
                await Out.WriteLineAsync("Unable to locate the Chauffeur directory");
            }

            await Out.WriteLineFormattedAsync("Connection string: {0}", settings.ConnectionString);

            return(DeliverableResponse.Continue);
        }
Exemplo n.º 2
0
        public async Task DifferentVersions_UpgradeIsCompleted()
        {
            migrationRunnerService.Execute(Arg.Any <SemVersion>(), Arg.Any <SemVersion>()).Returns(true);
            var anyStringArg = Arg.Any <string>();

            settings.TryGetSiteRootDirectory(out anyStringArg).Returns(
                x => {
                x[0] = @"C:\test\umbraco";
                return(true);
            });

            var xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(
                "<configuration>" +
                "<appSettings>" +
                "<add key=\"umbracoConfigurationStatus\" value=\"1.1.1\" />" +
                "</appSettings>" +
                "</configuration>"
                );

            xmlDocumentWrapper.LoadDocument(Arg.Any <string>()).Returns(xmlDoc);

            var deliverable = new UpgradeDeliverable(null, writer, migrationRunnerService,
                                                     MigrationEntryService(new SemVersion(7, 1)), settings, xmlDocumentWrapper);

            var response = await deliverable.Run(null, null);

            Assert.Equal(2, writer.Messages.Count());
            Assert.Equal(DeliverableResponse.Continue, response);
        }
Exemplo n.º 3
0
        public async override Task <DeliverableResponse> Run(string command, string[] args)
        {
            var dic = new Dictionary <string, string>();

            string path;

            if (settings.TryGetSiteRootDirectory(out path))
            {
                dic.Add("Site Root", path);
            }
            else
            {
                dic.Add("Site Root", "Failed to access");
            }

            if (settings.TryGetUmbracoDirectory(out path))
            {
                dic.Add("Umbraco Directory", path);
            }
            else
            {
                dic.Add("Umbraco Directory", "Failed to access");
            }

            if (settings.TryGetChauffeurDirectory(out path))
            {
                dic.Add("Chauffeur Directory", path);
            }
            else
            {
                dic.Add("Chauffeur Directory", "Failed to access");
            }

            dic.Add("Connection String", settings.ConnectionString.ConnectionString);

            await Out.WriteTableAsync(dic.Keys.Select(key => new
            {
                Setting = key,
                Value   = dic[key]
            }));

            return(DeliverableResponse.Continue);
        }