Hi
The problem is that atom.MockedInstance is null when you use it in the test code.
This is because MockManager.Mock() will mock the NEXT call to
new Atom().
Check out
this post in our blog for more details.
As a solution you can look at the
Built-In Argument Checks in Typemock Isolator documentation.
I can think of two checks that may solve your problem
Check.IsTypeOf() or Check.IsMock()
[Test]
public void TestMockedInstance2()
{
Mock atom = MockManager.Mock(typeof(Atom));
atom.ExpectConstructor().Args("Hydrogen");
Mock reactor = MockManager.Mock(typeof(Reactor));
//choose one of the checks below
//reactor.ExpectCall("React").Args(Check.IsTypeOf(typeof(Atom)));
reactor.ExpectCall("React").Args(Check.IsMock(atom));
PowerPlant.StartChainReaction();
}
Hope it helps :)