コード例 #1
0
        public Test BuildFrom(MethodInfo method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            return(DecompilationTestFactory.CreateTestSuite(method));
        }
コード例 #2
0
        public override void RunTestMethod(TestCaseResult testResult)
        {
            DecompilationTestAttribute attribute = DecompilationTestFactory.GetDecompilationTestAttribute(Method);
            var body = attribute.GetMethodBody(this.type);

            string path = string.Concat(DecompilationTestFixture.TestCasesDirectory, Path.DirectorySeparatorChar + resultFilename);

            if (attribute.Mode == Mode.MethodDefinition)
            {
                Reflect.InvokeMethod(Method, Fixture, new object[] { body.Method, File.ReadAllText(path) });
            }
            else
            {
                Reflect.InvokeMethod(Method, Fixture, new object[] { body, File.ReadAllText(path) });
            }
        }