Package mockit
Class ExpectationsWithInvocationCountsTest
java.lang.Object
mockit.ExpectationsWithInvocationCountsTest
The Class ExpectationsWithInvocationCountsTest.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Catch unexpected invocation and continue.void
Expect at least once and replay twice.void
expectAtLeastOneInvocationMatchingStrictExpectationButInvokeNone
(mockit.ExpectationsWithInvocationCountsTest.Collaborator a) Expect at least one invocation matching strict expectation but invoke none.void
expectAtLeastTwiceButReplayOnceWithSingleExpectation
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at least twice but replay once with single expectation.void
expectAtLeastTwiceButReplayOnceWithTwoConsecutiveExpectations
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at least twice but replay once with two consecutive expectations.void
Expect at most once but replay twice.void
Expect at most twice and replay once.void
Expect exactly twice but replay more times.void
Expect once.void
Expect once but replay more times.void
Expect once but replay twice.void
expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_maxTimes
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect one or more invocations followed by another which wont occur max times.void
expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_minTimes
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect one or more invocations followed by another which wont occur min times.void
expectSameMethodOnceOrTwiceThenOnceButReplayEachExpectationOnlyOnce
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect same method once or twice then once but replay each expectation only once.void
Expect twice by using invocation count.void
expectTwiceByUsingInvocationCountButReplayOnlyOnce
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect twice by using invocation count but replay only once.void
Expect two or three times.void
Expect zero or more times and replay twice.void
Repeats at least overwriting upper limit.void
repeatsAtMostDoesNotOverwriteLowerLimit
(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Repeats at most does not overwrite lower limit.
-
Constructor Details
-
ExpectationsWithInvocationCountsTest
public ExpectationsWithInvocationCountsTest()
-
-
Method Details
-
expectOnce
Expect once.- Parameters:
mock
- the mock
-
expectOnceButReplayTwice
Expect once but replay twice.- Parameters:
mock
- the mock
-
expectOnceButReplayMoreTimes
public void expectOnceButReplayMoreTimes(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect once but replay more times.- Parameters:
mock
- the mock
-
catchUnexpectedInvocationAndContinue
public void catchUnexpectedInvocationAndContinue(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Catch unexpected invocation and continue.- Parameters:
mock
- the mock
-
expectTwiceByUsingInvocationCount
public void expectTwiceByUsingInvocationCount(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect twice by using invocation count.- Parameters:
mock
- the mock
-
expectTwiceByUsingInvocationCountButReplayOnlyOnce
public void expectTwiceByUsingInvocationCountButReplayOnlyOnce(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect twice by using invocation count but replay only once.- Parameters:
mock
- the mock
-
expectExactlyTwiceButReplayMoreTimes
public void expectExactlyTwiceButReplayMoreTimes(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect exactly twice but replay more times.- Parameters:
mock
- the mock
-
expectAtLeastOnceAndReplayTwice
public void expectAtLeastOnceAndReplayTwice(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at least once and replay twice.- Parameters:
mock
- the mock
-
expectAtLeastTwiceButReplayOnceWithSingleExpectation
public void expectAtLeastTwiceButReplayOnceWithSingleExpectation(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at least twice but replay once with single expectation.- Parameters:
mock
- the mock
-
expectAtLeastTwiceButReplayOnceWithTwoConsecutiveExpectations
public void expectAtLeastTwiceButReplayOnceWithTwoConsecutiveExpectations(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at least twice but replay once with two consecutive expectations.- Parameters:
mock
- the mock
-
repeatsAtLeastOverwritingUpperLimit
public void repeatsAtLeastOverwritingUpperLimit(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Repeats at least overwriting upper limit.- Parameters:
mock
- the mock
-
expectAtMostTwiceAndReplayOnce
public void expectAtMostTwiceAndReplayOnce(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at most twice and replay once.- Parameters:
mock
- the mock
-
expectAtMostOnceButReplayTwice
public void expectAtMostOnceButReplayTwice(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect at most once but replay twice.- Parameters:
mock
- the mock
-
repeatsAtMostDoesNotOverwriteLowerLimit
public void repeatsAtMostDoesNotOverwriteLowerLimit(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Repeats at most does not overwrite lower limit.- Parameters:
mock
- the mock
-
expectSameMethodOnceOrTwiceThenOnceButReplayEachExpectationOnlyOnce
public void expectSameMethodOnceOrTwiceThenOnceButReplayEachExpectationOnlyOnce(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect same method once or twice then once but replay each expectation only once.- Parameters:
mock
- the mock
-
expectTwoOrThreeTimes
Expect two or three times.- Parameters:
mock
- the mock
-
expectZeroOrMoreTimesAndReplayTwice
public void expectZeroOrMoreTimesAndReplayTwice(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect zero or more times and replay twice.- Parameters:
mock
- the mock
-
expectAtLeastOneInvocationMatchingStrictExpectationButInvokeNone
public void expectAtLeastOneInvocationMatchingStrictExpectationButInvokeNone(mockit.ExpectationsWithInvocationCountsTest.Collaborator a) Expect at least one invocation matching strict expectation but invoke none.- Parameters:
a
- the a
-
expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_maxTimes
public void expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_maxTimes(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect one or more invocations followed by another which wont occur max times.- Parameters:
mock
- the mock
-
expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_minTimes
public void expectOneOrMoreInvocationsFollowedByAnotherWhichWontOccur_minTimes(mockit.ExpectationsWithInvocationCountsTest.Collaborator mock) Expect one or more invocations followed by another which wont occur min times.- Parameters:
mock
- the mock
-