public void MethodCodeLocation() { MethodInfo target = typeof(ReflectionPolicySample.Class1).GetMethod("Method1"); IMethodInfo info = GetMethod(target); var codeLocation = info.GetCodeLocation(); if (codeLocation != CodeLocation.Unknown) { Assert.EndsWith(codeLocation.Path, "ReflectionPolicySample.cs"); } }