
|
If you were logged in you would be able to see more operations.
|
|
|
Unitils
Created: 21/Jul/09 09:56 AM
Updated: 21/Jul/09 10:05 AM
|
|
| Component/s: |
mock
|
| Affects Version/s: |
2.3
|
| Fix Version/s: |
3.0
|
|
|
For example:
mockObject.returns("value1").testMethod(null, null, null);
mockObject.returns("value2").testMethod("arg1", null, null);
should return value2 if invoked with "arg1" as first argument value.
This way you could for example specify the default behavior in the before method and then specify more specific behavior in the test methods.
E.g
public class MyTest {
@Before
public void setDefaults(){
mockObject.returns("value1").testMethod(null, null, null);
}
@Test
public void myTest(){
mockObject.returns("value2").testMethod("arg1", null, null);
....
}
}
|
|
Description
|
For example:
mockObject.returns("value1").testMethod(null, null, null);
mockObject.returns("value2").testMethod("arg1", null, null);
should return value2 if invoked with "arg1" as first argument value.
This way you could for example specify the default behavior in the before method and then specify more specific behavior in the test methods.
E.g
public class MyTest {
@Before
public void setDefaults(){
mockObject.returns("value1").testMethod(null, null, null);
}
@Test
public void myTest(){
mockObject.returns("value2").testMethod("arg1", null, null);
....
}
}
|
Show » |
| There are no comments yet on this issue.
|
|