Ejemplo n.º 1
0
        public override IMessages Run()
        {
            Messages messages = new Messages();

            string fileName = Path.Combine(Directory.GetCurrentDirectory(), this.AssemblyPath);

            if (!File.Exists(fileName))
            {
                messages.AddWarning(string.Format("The tester assembly {0} doesn't exist.", fileName));
                return(messages);
            }

            try
            {
                var nunitConsolePath = Path.Combine(RegistryUtilities.ReadDefaultValue(@"HKEY_CURRENT_USER\SOFTWARE\nunit.org\NUnit\2.5.7", "InstallDir"), @"bin\net-2.0\nunit-console.exe");

                if (!File.Exists(nunitConsolePath))
                {
                    messages.AddWarning(string.Format("The nunit console path {0} doesn't exist.", nunitConsolePath));
                    return(messages);
                }

                SystemUtilities.StartProcess(nunitConsolePath, string.Format("{0} /xml:{1}", fileName, this.OutputPath, this.HideWindow), 1000);

                messages = this.ReadMessages(this.OutputPath);
            }
            catch (Exception e)
            {
                messages.AddException(e);
            }

            return(messages);
        }
Ejemplo n.º 2
0
        private string GetApplicationPath()
        {
            switch (this.ApplicationName)
            {
            case APP_SLICKDIFF:
                var vsPath = RegistryUtilities.ReadDefaultValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vs.exe");
                return(vsPath.Replace("vs.exe", "vsdiff.exe"));

            case APP_WINMERGE:
                return(RegistryUtilities.ReadDefaultValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinMerge.exe"));

            default:
                return(string.Empty);
            }
        }