protected IMethodGraph BuildMethodGraph(Method method)
 {
     IProblemPipe problemPipe = new TypeParser();
       IBlacklistManager blacklistManager = new IDbCommandBlacklistManagerStub();
       IMethodGraphBuilder methodGraphBuilder = new MethodGraphBuilder (method, blacklistManager, problemPipe);
       methodGraphBuilder.Build();
       IMethodGraph methodGraph = methodGraphBuilder.GetResult();
       return methodGraph;
 }
        public void Check_CallsBlackLisManagerToCheckForFragmentGenerator()
        {
            TypeNode sample = IntrospectionUtility.TypeNodeFactory<FragmentGeneratorSample>();
              var blacklistManager = MockRepository.GenerateStub<IBlacklistManager>();
              const bool isGenerator = true;

              blacklistManager.Stub (
              manager =>
              manager.GetFragmentTypes (
                  Arg<string>.Is.Anything,
                  Arg<string>.Is.Anything,
                  Arg<string>.Matches (_ => _ != "UnsafeWithoutGenerator"),
                  Arg<IList<string>>.Is.Anything)).Return (new FragmentSignature (new string[0], "", isGenerator));

              blacklistManager.Stub (_ => _.GetFragmentTypes (sample.DeclaringModule.Name, sample.FullName, "UnsafeWithoutGenerator", new string[0]))
              .Return (new FragmentSignature (new string[0], "", isGenerator));

              _typeParser = new TypeParser (blacklistManager);
              _typeParser.BeforeAnalysis();
              _typeParser.Check (sample);

              Assert.That(TestHelper.ContainsProblemID(c_InjectionCopRuleId, _typeParser.Problems), Is.False);
        }
 public void SetUp()
 {
     _typeParser = new TypeParser ();
       _typeParser.InitializeBlacklistManager (IntrospectionUtility.TypeNodeFactory<TypeParserTestBase>());
       _typeParser.BeforeAnalysis();
 }