Exemple #1
0
        private async Task <UnitTestCreationOptions> ShowCreateUnitTestsForMethodModalWindowAsync(MethodUnderTestAnalyzerResult analyzerResult)
        {
            var solutionModel = await this.VisualStudio.GetSolutionAsync();

            var createUnitTestsViewModel = new CreateUnitTestsForMethodViewModel(solutionModel, analyzerResult);

            var createUnitTestsForMethodWindow = new CreateUnitTestsForMethodWindow(createUnitTestsViewModel)
            {
                Owner = Application.Current.MainWindow
            };
            var dialogResult = createUnitTestsForMethodWindow.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value)
            {
                return(createUnitTestsViewModel.UnitTestCreationOptions());
            }

            return(null);
        }
Exemple #2
0
 public CreateUnitTestsForMethodWindow(CreateUnitTestsForMethodViewModel viewModel)
 {
     this.InitializeComponent();
     this.viewModel   = viewModel;
     this.DataContext = viewModel;
 }