コード例 #1
0
        private MethodDeclarationSyntax ProduceTestMethodForExceptionCluster(
            TestCaseExceptionEquivalenceCluster cluster, int clustersCount, TestMethodNamer testMethodNamer)
        {
            var testCasesToRemain   = cluster.EquivalentItems.Select(i => i.AttributeNode).ToArray();
            var exceptionExpectancy = cluster.EquivalentItems.First();

            var clusterMethod = _method.WithoutExceptionExpectancyInAttributes(testCasesToRemain)
                                .WithBody(CreateAssertedBlock(exceptionExpectancy)).WithTrailingTrivia(CreateClusterMethodTrailingTrivia(cluster))
                                .WithIdentifier(testMethodNamer.CreateName(exceptionExpectancy, clustersCount));

            return(clusterMethod);
        }
コード例 #2
0
        private MethodDeclarationSyntax ProduceTestMethodForTestCaseWithExpectedExceptionEquivalence(
            ExpectedExceptionTestCaseEquivalence equivalence, int equivalenceCount, TestMethodNamer testMethodNamer)
        {
            var testCasesToRemain   = equivalence.EquivalentItems.Select(i => i.AttributeNode).ToArray();
            var exceptionExpectancy = equivalence.EquivalentItems.First();

            var clusterMethod = methodToBeFixed.WithoutExceptionExpectancyInAttributes(testCasesToRemain)
                                .WithBody(CreateAssertedBlock(exceptionExpectancy)).WithTrailingTrivia(CreateClusterMethodTrailingTrivia(equivalence))
                                .WithIdentifier(testMethodNamer.CreateName(exceptionExpectancy, equivalenceCount));

            return(clusterMethod);
        }