示例#1
0
        public void TestReferenceMethod1Test()
        {
            TestReferenceMethod1();

            var moduleDef   = Helpers.LoadTestModuleDef();
            var thisTypeDef = moduleDef.Find("Confuser.Renamer.Test.Analyzers.ReflectionAnalyzerTest", false);
            var refMethod   = thisTypeDef.FindMethod(nameof(TestReferenceMethod1));

            var nameService = Mock.Of <INameService>();

            Mock.Get(nameService).Setup(s => s.SetCanRename(refMethod, false));
            Mock.Get(nameService).Setup(s => s.SetCanRename(refMethod, false));

            var traceService = new TraceService();
            var analyzer     = new ReflectionAnalyzer();

            analyzer.Analyze(nameService, traceService, new List <ModuleDef>()
            {
                moduleDef
            }, refMethod);

            Mock.Get(nameService).VerifyAll();
        }