Home
last modified time | relevance | path

Searched refs:mock2 (Results 1 – 23 of 23) sorted by relevance

/external/mockito/src/test/java/org/mockitousage/internal/junit/
DUnusedStubbingsFinderTest.java32 @Mock IMethods mock2; field in UnusedStubbingsFinderTest
37 assertEquals(0, finder.getUnusedStubbings((List) asList(mock1, mock2)).size()); in no_interactions()
38 assertEquals(0, finder.getUnusedStubbingsByLocation((List) asList(mock1, mock2)).size()); in no_interactions()
47 assertEquals(0, finder.getUnusedStubbings((List) asList(mock1, mock2)).size()); in no_stubbings()
48 assertEquals(0, finder.getUnusedStubbingsByLocation((List) asList(mock1, mock2)).size()); in no_stubbings()
58 assertEquals(0, finder.getUnusedStubbings((List) asList(mock1, mock2)).size()); in no_unused_stubbings()
59 assertEquals(0, finder.getUnusedStubbingsByLocation((List) asList(mock1, mock2)).size()); in no_unused_stubbings()
68 assertEquals(1, finder.getUnusedStubbings((List) asList(mock1, mock2)).size()); in unused_stubbings()
69 assertEquals(1, finder.getUnusedStubbingsByLocation((List) asList(mock1, mock2)).size()); in unused_stubbings()
75 when(mock2.simpleMethod(2)).thenReturn("2"); in some_unused_stubbings()
[all …]
/external/mockito/src/test/java/org/mockito/internal/junit/
DArgMismatchFinderTest.java20 @Mock IMethods mock2; field in ArgMismatchFinderTest
25 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in no_interactions()
35 mock2.simpleMethod(2); //arg mismatch on different mock in no_mismatch_when_mock_different()
38 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in no_mismatch_when_mock_different()
51 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in no_mismatch_when_method_different()
65 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in no_mismatch_when_stubbing_used()
78 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in stubbing_mismatch()
92 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in single_mismatch_with_multiple_invocations()
107 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in single_invocation_with_multiple_stubs()
124 StubbingArgMismatches mismatches = finder.getStubbingArgMismatches(asList(mock1, mock2)); in mismatch_reports_only_unstubbed_invocations()
/external/mockito/src/test/java/org/mockitousage/verification/
DFindingRedundantInvocationsInOrderTest.java24 @Mock private IMethods mock2; field in FindingRedundantInvocationsInOrderTest
68 mock2.simpleMethod(); in shouldVerifyNoMoreInteractionsInOrderWithMultipleMocks()
72 InOrder inOrder = inOrder(mock, mock2); in shouldVerifyNoMoreInteractionsInOrderWithMultipleMocks()
73 inOrder.verify(mock2).simpleMethod(); in shouldVerifyNoMoreInteractionsInOrderWithMultipleMocks()
98 mock2.simpleMethod(); in shouldFailToVerifyNoMoreInteractionsInOrderWithMultipleMocks()
102 InOrder inOrder = inOrder(mock, mock2); in shouldFailToVerifyNoMoreInteractionsInOrderWithMultipleMocks()
103 inOrder.verify(mock2).simpleMethod(); in shouldFailToVerifyNoMoreInteractionsInOrderWithMultipleMocks()
DVerificationStartedListenerTest.java38 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in verified_mock_can_be_replaced() local
46 List verifiedMock = verify(mock2); in verified_mock_can_be_replaced()
81 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in listeners_are_executed_in_sequence() local
95 verify(mock2, never()).clear(); in listeners_are_executed_in_sequence()
100 Assertions.assertThat(container).containsExactly(mock2, mock1); in listeners_are_executed_in_sequence()
DOnlyVerificationTest.java25 @Mock private List<Object> mock2; field in OnlyVerificationTest
81 mock2.get(0); in shouldVerifyMethodWasInvokedExclusivelyWhenTwoMocksInUse()
83 verify(mock2, only()).get(0); in shouldVerifyMethodWasInvokedExclusivelyWhenTwoMocksInUse()
/external/mockito/src/test/java/org/mockitousage/junitrule/
DStrictJUnitRuleTest.java32 @Mock IMethods mock2; field in StrictJUnitRuleTest
56 mock2.simpleMethod(10); in fails_when_unused_stubbings()
151 given(mock2.simpleMethod(20)).willReturn("foo"); in unused_stubs_with_multiple_mocks()
157 mock2.booleanObjectReturningMethod(); in unused_stubs_with_multiple_mocks()
/external/mockito/src/test/java/org/mockitousage/bugs/
DNPEWhenMockingThrowablesTest.java19 @Mock DummyException mock2; field in NPEWhenMockingThrowablesTest
28 when(mock.simpleMethod()).thenThrow(mock2); in shouldNotThrowNPE()
DCovariantOverrideTest.java53 ReturnsObject mock2 = mock; // Switch to base type to call covariant override in returnFoo4() local
54 verify(mock2).callMe(); // Fails: java.lang.AssertionError: expected:<foo> but was:<null> in returnFoo4()
/external/jacoco/org.jacoco.report.test/src/org/jacoco/report/
DMultiReportVisitorTest.java120 IReportVisitor mock2 = new MockVisitor(); in testMultiFormatter() local
122 List<IReportVisitor> visitors = Arrays.asList(mock1, mock2, mock3); in testMultiFormatter()
126 assertEquals(MOCK_REPORT, mock2.toString()); in testMultiFormatter()
/external/mockito/src/test/java/org/mockitousage/junitrunner/
DUnusedStubsExceptionMessageTest.java28 IMethods mock2 = when(mock(IMethods.class).simpleMethod(2)).thenReturn("2").getMock(); field in UnusedStubsExceptionMessageTest.HasUnnecessaryStubs
38 assertEquals(null, mock2.simpleMethod(200)); in usesStubWithDifferentArg()
DSilentRunnerTest.java120 IMethods mock2 = when(mock(IMethods.class).simpleMethod(2)).thenReturn("2").getMock(); field in SilentRunnerTest.HasUnnecessaryStubs
130 assertEquals(null, mock2.simpleMethod(200)); in usesStubWithDifferentArg()
DStrictRunnerTest.java134 IMethods mock2 = mock(IMethods.class); field in StrictRunnerTest.WithUnrelatedAssertionFailure
137 when(mock2.simpleMethod("unused stubbing")).thenReturn(""); in before()
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DCompositeReadableBufferTest.java160 ReadableBuffer mock2 = mock(ReadableBuffer.class); in closeShouldCloseBuffers() local
162 composite.addBuffer(mock2); in closeShouldCloseBuffers()
166 verify(mock2).close(); in closeShouldCloseBuffers()
/external/mockito/src/test/java/org/mockito/internal/framework/
DDefaultMockitoFrameworkTest.java69 Set mock2 = mock(Set.class); in adds_creation_listener() local
73 verify(listener).onMockCreated(eq(mock2), any(MockCreationSettings.class)); in adds_creation_listener()
/external/mockito/src/test/java/org/mockitousage/session/
DMockitoSessionTest.java178 IMethods mock2 = Mockito.mock(IMethods.class, "manual mock"); field in MockitoSessionTest.SessionWithManuallyInitializedMock
188 …assertEquals("manual mock", mockingDetails(mock2).getMockCreationSettings().getMockName().toString… in manual_mock_preserves_its_settings()
/external/mockito/src/test/java/org/mockito/internal/util/collections/
DHashCodeAndEqualsSafeSetTest.java46 UnmockableHashCodeAndEquals mock2 = mock(UnmockableHashCodeAndEquals.class); in mock_with_failing_equals_method_can_be_used() local
47 assertThat(mocks.contains(mock2)).isFalse(); in mock_with_failing_equals_method_can_be_used()
/external/mockito/src/test/java/org/mockitousage/basicapi/
DMocksSerializationTest.java216 IMethods mock2 = mock(IMethods.class, withSettings().serializable()); in should_verify_call_order_for_serialized_mock() local
218 mock2.arrayReturningMethod(); in should_verify_call_order_for_serialized_mock()
222 ByteArrayOutputStream serialized2 = serializeMock(mock2); in should_verify_call_order_for_serialized_mock()
/external/webrtc/webrtc/modules/audio_device/ios/
Daudio_device_unittest_ios.cc681 MockAudioTransport mock2(kPlayout); in TEST_F() local
682 mock2.HandleCallbacks(test_is_done_.get(), nullptr, kNumCallbacks); in TEST_F()
684 mock2, NeedMorePlayData(playout_frames_per_10ms_buffer(), kBytesPerSample, in TEST_F()
688 EXPECT_EQ(0, second_audio_device->RegisterAudioCallback(&mock2)); in TEST_F()
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestpatch.py227 def test(this1, this2, mock1, mock2): argument
234 self.assertEqual(mock2, Test.something,
236 self.assertIsInstance(mock2, MagicMock,
238 self.assertIsInstance(mock2, MagicMock,
243 self.assertNotEqual(outerMock2, mock2, "unexpected value for mock1")
244 return mock1, mock2
Dtestmagicmethods.py49 mock2 = Mock()
53 self.assertRaises(TypeError, lambda: list(mock2))
/external/python/mock/mock/tests/
Dtestpatch.py231 def test(this1, this2, mock1, mock2): argument
238 self.assertEqual(mock2, Test.something,
240 self.assertIsInstance(mock2, MagicMock,
242 self.assertIsInstance(mock2, MagicMock,
247 self.assertNotEqual(outerMock2, mock2, "unexpected value for mock1")
248 return mock1, mock2
Dtestmagicmethods.py68 mock2 = Mock()
72 self.assertRaises(TypeError, lambda: list(mock2))
/external/python/cpython3/Doc/library/
Dunittest.mock.rst1562 ... def test(mock1, mock2):
1564 ... assert SomeClass.class_method is mock2
1567 ... return mock1, mock2
1569 >>> mock1, mock2 = test()
1571 >>> mock2.assert_called_once_with('bar')