示例#1
0
        public MutationConfigWindowViewModel(EnvironmentService environmentService, SolutionInfoService solutionInfoService)
        {
            _environmentService  = environmentService;
            _solutionInfoService = solutionInfoService;

            TestRunnerTypes = new List <string> {
                "DotNet"
            };

            TestProjectChangedCommand = new DelegateCommand <string>(TestProjectChanged);
            AddFileCommand            = new DelegateCommand(AddFileToFilter);
            AddLineCommand            = new DelegateCommand(AddLineToFilter);
            AddCodeConstrainCommand   = new DelegateCommand(AddCodeConstrainToFilter);

            ProjectGridItems          = new ObservableCollection <ConfigProjectGridItem>();
            NumberOfParallelTestRuns  = 3;
            MutationOperatorGridItems = new ObservableCollection <MutationOperatorGridItem>(Enum
                                                                                            .GetValues(typeof(MutationOperators)).Cast <MutationOperators>().Select(m =>
                                                                                                                                                                    new MutationOperatorGridItem
            {
                IsSelected       = true,
                MutationOperator = m,
                Description      = m.GetValue()
            }));

            _jsonSettings = new JsonSerializerSettings();

            _jsonSettings.NullValueHandling = NullValueHandling.Ignore;
            _jsonSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
        }
        private MutationConfigWindowCommand(
            AsyncPackage package,
            OleMenuCommandService commandService,
            UserNotificationService userNotificationService,
            EnvironmentService environmentService,
            SolutionInfoService solutionInfoService)
        {
            _package = package ?? throw new ArgumentNullException(nameof(package));
            _userNotificationService = userNotificationService;
            _environmentService      = environmentService;
            _solutionInfoService     = solutionInfoService;
            commandService           = commandService ?? throw new ArgumentNullException(nameof(commandService));

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem      = new MenuCommand(Execute, menuCommandID);

            commandService.AddCommand(menuItem);
        }
示例#3
0
 public NewProjectViewModel(
     FilePicker filePickerService,
     SolutionInfoService solutionInfoService,
     ILoadingDisplayer loadingDisplayer,
     IMediator mediator,
     IMutationModuleTabOpener mutationModuleTabOpener)
 {
     _filePickerService       = filePickerService;
     _solutionInfoService     = solutionInfoService;
     _loadingDisplayer        = loadingDisplayer;
     _mediator                = mediator;
     _mutationModuleTabOpener = mutationModuleTabOpener;
     TestRunnerTypes          = new List <string> {
         "DotNet", "xUnit", "NUnit"
     };
     ProjectNamesInSolution     = new List <string>();
     ProjectPathCommand         = new DelegateCommand(PickProjectPath);
     SolutionPathCommand        = new DelegateCommand(PickSolutionPathAsync);
     CreateProjectCommand       = new DelegateCommand(CreateProject);
     SelectedProjectsInSolution = new List <ProjectListItem>();
 }
        public static async Task InitializeAsync(AsyncPackage package, UserNotificationService userNotificationService, EnvironmentService environmentService, SolutionInfoService solutionInfoService)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new MutationConfigWindowCommand(package, commandService, userNotificationService, environmentService, solutionInfoService);
        }
示例#5
0
 public ConfigService(EnvironmentService environmentService, SolutionInfoService solutionInfoService)
 {
     _environmentService  = environmentService;
     _solutionInfoService = solutionInfoService;
 }