Closed djrichar closed 10 years ago
Please review the example test class, because it got errors. That first assertion in the second test, for one, can never pass.
With a fixed and simplified version of the second test, I don't see any problem, it passes:
@Test
public void cascadingWithPartialMockingWithResult() {
final Bar expectedBar = new Bar();
new Expectations(Foo.class) {{
Foo.globalBar(); result = expectedBar;
}};
Bar actual = Foo.globalBar();
Assert.assertSame(expectedBar, actual);
}
The Tutorial document state:
so given the sample test below i would expect the 2nd test to pass however it fails