コード例 #1
0
        public void Test()
        {
            var gen = new XmlResultsGenerator(null, null, null, null, null);

            var muSession = new MutationTestingSession();

            var mutar = new MutationTarget(new MutationVariant());


            var ass = new AssemblyNode("Assembly");

            muSession.MutantsGrouped.Add(ass);
            var nodeNamespace = new TypeNamespaceNode(ass, "Namespace");

            ass.Children.Add(nodeNamespace);
            var nodeType = new TypeNode(nodeNamespace, "Type");

            nodeNamespace.Children.Add(nodeType);
            var nodeMethod = new MethodNode(nodeType, "Method", null, true);

            nodeType.Children.Add(nodeMethod);
            var nodeGroup = new MutantGroup("Gr1", nodeMethod);

            nodeMethod.Children.Add(nodeGroup);
            var nodeMutant = new Mutant("m1", nodeGroup, mutar);

            nodeGroup.Children.Add(nodeMutant);

            XDocument generateResults = gen.GenerateResults(muSession, false, false, ProgressCounter.Inactive(), CancellationToken.None).Result;

            Console.WriteLine(generateResults.ToString());
            //gen.
        }
コード例 #2
0
        public void Test()
        {
             var gen = new XmlResultsGenerator(null,null,null, null, null);

            var muSession = new MutationTestingSession();
            
            var mutar = new MutationTarget(new MutationVariant());


            var ass = new AssemblyNode("Assembly");
            muSession.MutantsGrouped.Add(ass);
            var nodeNamespace = new TypeNamespaceNode(ass, "Namespace");
            ass.Children.Add(nodeNamespace);
            var nodeType = new TypeNode(nodeNamespace, "Type");
            nodeNamespace.Children.Add(nodeType);
            var nodeMethod = new MethodNode(nodeType, "Method", null, true);
            nodeType.Children.Add(nodeMethod);
            var nodeGroup = new MutantGroup("Gr1", nodeMethod);
            nodeMethod.Children.Add(nodeGroup);
            var nodeMutant = new Mutant("m1", nodeGroup, mutar);
            nodeGroup.Children.Add(nodeMutant);

            XDocument generateResults = gen.GenerateResults(muSession, false, false, ProgressCounter.Inactive(), CancellationToken.None).Result;

            Console.WriteLine(generateResults.ToString());
            //gen.
        }
コード例 #3
0
        public ResultsSavingController(
            ResultsSavingViewModel viewModel, 
            IFileSystem fs,
            CommonServices svc,
            XmlResultsGenerator generator)
        {
            _viewModel = viewModel;
            _fs = fs;
            _svc = svc;
            _generator = generator;



            _viewModel.CommandSaveResults = new SmartCommand(async () =>
            {
                try
                {
                    await SaveResults();
                }
                catch (OperationCanceledException e)
                {
                    Close();
                }
                catch (Exception e)
                {
                    _log.Error(e);
                }
            },
                canExecute: () => !_viewModel.SavingInProgress)
                .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            _viewModel.CommandClose = new SmartCommand(() =>
            {
                if(_cts != null)
                {
                    _cts.Cancel();
                    _viewModel.IsCancelled = true;
                }
                else
                {
                    Close();
                }
            },
                canExecute: () => !_viewModel.IsCancelled)
                .UpdateOnChanged(_viewModel, _ => _.IsCancelled);

            _viewModel.CommandBrowse = new SmartCommand(BrowsePath, 
                canExecute: () => !_viewModel.SavingInProgress)
                .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            if (_svc.Settings.ContainsKey("MutationResultsFilePath"))
            {
                _viewModel.TargetPath = _svc.Settings["MutationResultsFilePath"];
            }
           
        }
コード例 #4
0
        public ResultsSavingController(
            ResultsSavingViewModel viewModel,
            IFileSystem fs,
            CommonServices svc,
            XmlResultsGenerator generator)
        {
            _viewModel = viewModel;
            _fs        = fs;
            _svc       = svc;
            _generator = generator;



            _viewModel.CommandSaveResults = new SmartCommand(async() =>
            {
                try
                {
                    await SaveResults();
                }
                catch (OperationCanceledException e)
                {
                    Close();
                }
                catch (Exception e)
                {
                    _log.Error(e);
                }
            },
                                                             canExecute: () => !_viewModel.SavingInProgress)
                                            .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            _viewModel.CommandClose = new SmartCommand(() =>
            {
                if (_cts != null)
                {
                    _cts.Cancel();
                    _viewModel.IsCancelled = true;
                }
                else
                {
                    Close();
                }
            },
                                                       canExecute: () => !_viewModel.IsCancelled)
                                      .UpdateOnChanged(_viewModel, _ => _.IsCancelled);

            _viewModel.CommandBrowse = new SmartCommand(BrowsePath,
                                                        canExecute: () => !_viewModel.SavingInProgress)
                                       .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            if (_svc.Settings.ContainsKey("MutationResultsFilePath"))
            {
                _viewModel.TargetPath = _svc.Settings["MutationResultsFilePath"];
            }
        }