예제 #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.
        }
        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 Mutant CreateEquivalentMutant(out AssemblyNode assemblyNode)
 {
     
     assemblyNode = new AssemblyNode("All modules");
     var nsNode = new TypeNamespaceNode(assemblyNode, "");
     assemblyNode.Children.Add(nsNode);
     var typeNode = new TypeNode(nsNode, "");
     nsNode.Children.Add(typeNode);
     var methodNode = new MethodNode(typeNode, "", null, true);
     typeNode.Children.Add(methodNode);
     var group = new MutantGroup("Testing original program", methodNode);
     var target = new MutationTarget(new MutationVariant())
                  {
                      Name = "Original program",
                  };
     var mutant = new Mutant("0", group, target);
    
     group.Children.Add(mutant);
     methodNode.Children.Add(group);
     group.UpdateDisplayedText();
     return mutant;
 }
예제 #4
0
        public Mutant CreateEquivalentMutant(out AssemblyNode assemblyNode)
        {
            assemblyNode = new AssemblyNode("All modules");
            var nsNode = new TypeNamespaceNode(assemblyNode, "");

            assemblyNode.Children.Add(nsNode);
            var typeNode = new TypeNode(nsNode, "");

            nsNode.Children.Add(typeNode);
            var methodNode = new MethodNode(typeNode, "", null, true);

            typeNode.Children.Add(methodNode);
            var group  = new MutantGroup("Testing original program", methodNode);
            var target = new MutationTarget(new MutationVariant())
            {
                Name = "Original program",
            };
            var mutant = new Mutant("0", group, target);

            group.Children.Add(mutant);
            methodNode.Children.Add(group);
            group.UpdateDisplayedText();
            return(mutant);
        }