Exemplo n.º 1
0
        private void RunDotNetFrameworkImplementation()
        {
            var runAllBatchFileLocation   = Utilities.GetAssemblyDirectory + "\\runall.bat";
            var runTestsBatchFileLocation = Utilities.GetAssemblyDirectory + "\\runtests.bat";

            LogMessages.Add(LogMessage.Log($"Generating runtests.bat file to: {runTestsBatchFileLocation}", LogMessage.LogType.Info));
            BatchFileHelper.CreateRunTestsBatchFile(TestProjects.Where(a => a.IsSelected), runTestsBatchFileLocation);
            LogMessages.Add(LogMessage.Log("Generated runtests.bat", LogMessage.LogType.Success));

            LogMessages.Add(LogMessage.Log($"Generating runall.bat to: {runAllBatchFileLocation}", LogMessage.LogType.Info));
            BatchFileHelper.CreateRunAllBatchFile(AssemblyProjects.Where(a => a.IsSelected), runAllBatchFileLocation);
            LogMessages.Add(LogMessage.Log("Generated runall.bat", LogMessage.LogType.Success));

            BatchFileHelper.RunBatchFile(runAllBatchFileLocation);
            LogMessages.Add(LogMessage.Log("Successfully ran main batch file", LogMessage.LogType.Success));
        }
Exemplo n.º 2
0
        private string HasDebugFullOn()
        {
            var message = string.Empty;

            foreach (var project in TestProjects.Where(proj => proj.IsSelected))
            {
                var csprojDoc = XDocument.Parse(File.ReadAllText(project.AssemblyFilePath));
                var element   = csprojDoc.XPathSelectElement("Project/PropertyGroup/DebugType");

                if (element != null && !string.Equals(element.Value, "full", StringComparison.CurrentCultureIgnoreCase))
                {
                    message += $" - The project '{project.Name}'{Environment.NewLine}";
                }
            }

            return(message);
        }
Exemplo n.º 3
0
        private void RunDotNetCoreImplementation()
        {
            var debugFullMessage = HasDebugFullOn();

            if (!string.IsNullOrEmpty(debugFullMessage))
            {
                var message = $"Invalid project setup: {Environment.NewLine}{Environment.NewLine}{debugFullMessage}{Environment.NewLine}{Environment.NewLine}" +
                              "Project/PropertyGroup/DebugType in the csproj setup correctly, the value must be 'Full'.";

                MessageBox.Show(message, "Debug mode not setup", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            var runAllBatchFileLocation = Utilities.GetAssemblyDirectory + "\\rundotnetcore.bat";

            LogMessages.Add(LogMessage.Log($"Generating rundotnetcore.bat file to: {runAllBatchFileLocation}", LogMessage.LogType.Info));
            BatchFileHelper.CreateDotNetCoreBatchFile(TestProjects.Where(a => a.IsSelected), runAllBatchFileLocation);
            LogMessages.Add(LogMessage.Log("Generated rundotnetcore.bat", LogMessage.LogType.Success));

            BatchFileHelper.RunBatchFile(runAllBatchFileLocation);
            LogMessages.Add(LogMessage.Log("Successfully rundotnetcore.bat batch file", LogMessage.LogType.Success));
        }