I'm looking for a way to ensure that method 'A' calls method 'B'. So roughly, the deal is..
class one
{
internal static void MethodA()
{
//Do Something here. SHOULD be calling B.
}
void MethodB()
{
//MUST be called by MethodA.
}
}
class two
{
internal void MethodA()
{
//Test that MethodA calls MethodB
}
}
I should point out that i'm stuck on .Net 2.0 for this one so ExpressionTrees are a no go. I'm not even sure they'd help but that was my initial thought.
EDIT: This is for an internal tool to visualize cyclomatic complexity of the source so I'm not concerned with breaking encapsulation here. Also,..it's likely this is going to have to be done just using System.Reflection.