コード例 #1
0
 private static string MemberBlockFromPrototypeTest(ModuleBodyElementDeclaration mbed, MemberBlockFromPrototypeTestParams testParams)
 => CreateCodeBuilder().BuildMemberBlockFromPrototype(mbed, testParams.Content, testParams.Accessibility, testParams.NewIdentifier);
コード例 #2
0
        private string ParseAndTest <T>(string inputCode, string targetIdentifier, DeclarationType declarationType, MemberBlockFromPrototypeTestParams testParams, Func <T, MemberBlockFromPrototypeTestParams, string> theTest)
        {
            var vbe   = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _).Object;
            var state = MockParser.CreateAndParse(vbe);

            using (state)
            {
                var target = state.DeclarationFinder.DeclarationsWithType(declarationType)
                             .Where(d => d.IdentifierName == targetIdentifier).OfType <T>()
                             .Single();
                return(theTest(target, testParams));
            }
        }