-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Prayag edited this page May 22, 2023
·
5 revisions
- references: https://martinfowler.com/bliki/UnitTest.html
- Interactions
While an interaction looks similar to a regular method invocation, it is simply a way to express which method invocations are expected to occur.
doSome
is interaction.
class A {
B b;
String doSome() {
Data bData = b.doSome()
//domeSomething with bData
return something;
}
}
- Interaction cardinality
how often a method call is expected, can be 0 or *.
class A {
B b;
String doSome() {
Data bData = b.doSome(args1)
Data cData = b.doSome(cargs1)
//domeSomething with bData
return something;
}
}
- Target cardinality
which dependency object is expected to receive the method call
- Arguments constraints
class A {
B b;
C c;
String doSome() {
Data bData = b.doSome(args1)
Data cData = c.doSome(cargs1)
return bData + cData;
}
}
-
b.doSome
is invoked withargs1
-
c.doSome
is invoked withcargs1