How to test built in recursive manner class with mspec/rhino mocks

30 Views Asked by At

I have for example class

public class Person {
    private Person Parent;
    private string Name;
    public Person(string Name, Person Parent)
    {
        if(Parent == null)
        {
            thrown new ArgumentNullException("Parent");
        }
        this.Parent = Parent;
        this.Name = Name;
    }
}

How to test if Parent of Person a is equal b, and at the same time, Parent of Person b is null with mspec and rhino mocks? I don't have access to function that in recursive manner populate Parent field, so I can't count its number of invokes, and therefore, level of depression. Is it even possible?

0

There are 0 best solutions below