/external/mockito/src/test/java/org/mockitousage/verification/ |
RelaxedVerificationInOrderTest.java | 39 mockOne.simpleMethod(1); 40 mockTwo.simpleMethod(2); 41 mockTwo.simpleMethod(2); 42 mockThree.simpleMethod(3); 43 mockTwo.simpleMethod(2); 44 mockOne.simpleMethod(4); 49 inOrder.verify(mockOne).simpleMethod(1); 50 inOrder.verify(mockTwo, times(2)).simpleMethod(2); 51 inOrder.verify(mockThree).simpleMethod(3); 52 inOrder.verify(mockTwo).simpleMethod(2) [all...] |
VerificationInOrderMixedWithOrdiraryVerificationTest.java | 33 mockOne.simpleMethod(1); 34 mockOne.simpleMethod(1); 35 mockTwo.simpleMethod(2); 36 mockThree.simpleMethod(3); 37 mockThree.simpleMethod(4); 44 inOrder.verify(mockOne, atLeastOnce()).simpleMethod(1); 45 inOrder.verify(mockThree).simpleMethod(3); 46 inOrder.verify(mockThree).simpleMethod(4); 47 verify(mockTwo).simpleMethod(2); 54 inOrder.verify(mockOne, atLeastOnce()).simpleMethod(1) [all...] |
BasicVerificationInOrderTest.java | 37 mockOne.simpleMethod(1); 38 mockTwo.simpleMethod(2); 39 mockTwo.simpleMethod(2); 40 mockThree.simpleMethod(3); 41 mockTwo.simpleMethod(2); 42 mockOne.simpleMethod(4); 47 inOrder.verify(mockOne).simpleMethod(1); 48 inOrder.verify(mockTwo, times(2)).simpleMethod(2); 49 inOrder.verify(mockThree).simpleMethod(3); 50 inOrder.verify(mockTwo).simpleMethod(2) [all...] |
VerificationInOrderTest.java | 41 mockOne.simpleMethod(1); 42 mockOne.simpleMethod(2); 44 verify(mockOne).simpleMethod(2); 45 verify(mockOne).simpleMethod(1); 47 inOrder.verify(mockOne).simpleMethod(2); 49 inOrder.verify(mockOne).simpleMethod(1); 57 mockOne.simpleMethod(); 69 mockOne.simpleMethod(); 70 mockOne.simpleMethod(); 72 mockOne.simpleMethod(); [all...] |
DescriptiveMessagesOnVerificationInOrderErrorsTest.java | 34 one.simpleMethod(1); 35 one.simpleMethod(11); 36 two.simpleMethod(2); 37 two.simpleMethod(2); 38 three.simpleMethod(3); 45 inOrder.verify(one).simpleMethod(1); 46 inOrder.verify(two, atLeastOnce()).simpleMethod(2); 49 inOrder.verify(one, atLeastOnce()).simpleMethod(11); 58 "iMethods.simpleMethod(11);" + 68 "iMethods.simpleMethod(2);" [all...] |
SelectedMocksInOrderVerificationTest.java | 31 mockOne.simpleMethod(1); 32 mockTwo.simpleMethod(2); 33 mockTwo.simpleMethod(2); 34 mockThree.simpleMethod(3); 35 mockTwo.simpleMethod(2); 36 mockOne.simpleMethod(4); 42 inOrder.verify(mockOne).simpleMethod(1); 43 inOrder.verify(mockTwo, times(2)).simpleMethod(2); 44 inOrder.verify(mockThree).simpleMethod(3); 45 inOrder.verify(mockTwo).simpleMethod(2) [all...] |
FindingRedundantInvocationsInOrderTest.java | 38 mock.simpleMethod(); 53 mock.simpleMethod(); 54 mock.simpleMethod(10); 59 inOrder.verify(mock).simpleMethod(10); 67 mock.simpleMethod(); 68 mock2.simpleMethod(); 73 inOrder.verify(mock2).simpleMethod(); 81 mock.simpleMethod(); 82 mock.simpleMethod(10); 87 inOrder.verify(mock).simpleMethod(10) [all...] |
/external/mockito/src/test/java/org/mockitousage/stubbing/ |
StubbingConsecutiveAnswersTest.java | 24 when(mock.simpleMethod()) 29 assertEquals("one", mock.simpleMethod()); 30 assertEquals("two", mock.simpleMethod()); 31 assertEquals("three", mock.simpleMethod()); 32 assertEquals("three", mock.simpleMethod()); 33 assertEquals("three", mock.simpleMethod()); 38 when(mock.simpleMethod()).thenReturn(null, (String[]) null); 40 assertNull(mock.simpleMethod()); 41 assertNull(mock.simpleMethod()); 46 when(mock.simpleMethod()).thenReturn("one", "two", "three") [all...] |
StubbingWarningsTest.java | 24 mock.simpleMethod(100); 34 given(mock.simpleMethod(100)).willReturn("100"); 35 mock.simpleMethod(100); 44 given(mock.simpleMethod(100)).willReturn("100"); 45 mock.simpleMethod(100); // <- stubbing is used 46 mock.simpleMethod(200); // <- other method should not generate arg mismatch 55 given(mock.simpleMethod(100)).willReturn("100"); 56 mock.simpleMethod(200); 71 given(mock.simpleMethod(100)).willReturn("100");
|
StrictStubbingTest.java | 36 mock.simpleMethod(100); 42 mock.simpleMethod(100); 46 verify(mock).simpleMethod(100); 53 given(mock.simpleMethod(100)).willReturn("100"); 54 mock.simpleMethod(100); 62 given(mock.simpleMethod(100)).willReturn("100"); 63 mock.simpleMethod(100); // <- implicitly verified 64 mock.simpleMethod(200); // <- unverified 76 given(mock.simpleMethod(100)).willReturn("100"); 81 mock.simpleMethod(200) [all...] |
StubbingUsingDoReturnTest.java | 37 doReturn("foo").when(mock).simpleMethod(); 38 doReturn("bar").when(mock).simpleMethod(); 40 Assertions.assertThat(mock.simpleMethod()).isEqualTo("bar"); 45 doReturn("foo").when(mock).simpleMethod("foo"); 46 doReturn("bar").when(mock).simpleMethod(eq("one"), anyInt()); 48 Assertions.assertThat(mock.simpleMethod("foo")).isEqualTo("foo"); 49 Assertions.assertThat(mock.simpleMethod("one", 234)).isEqualTo("bar"); 50 Assertions.assertThat(mock.simpleMethod("xxx", 234)).isEqualTo(null); 123 .when(mock).simpleMethod(); 125 Assertions.assertThat(mock.simpleMethod()).isEqualTo("foo") [all...] |
/external/mockito/src/test/java/org/concurrentmockito/ |
ThreadsShareGenerouslyStubbedMockTest.java | 31 when(mock.simpleMethod("foo")) 45 mock.simpleMethod("foo"); 46 mock.simpleMethod("foo"); 47 mock.simpleMethod("foo"); 48 mock.simpleMethod("foo"); 49 mock.simpleMethod("foo"); 50 mock.simpleMethod("foo");
|
/external/mockito/src/test/java/org/mockitousage/matchers/ |
VerificationAndStubbingUsingMatchersTest.java | 32 when(one.simpleMethod(2)).thenReturn("2"); 33 when(two.simpleMethod(anyString())).thenReturn("any"); 34 when(three.simpleMethod(startsWith("test"))).thenThrow(new RuntimeException()); 36 assertEquals(null, one.simpleMethod(1)); 37 assertEquals("2", one.simpleMethod(2)); 39 assertEquals("any", two.simpleMethod("two")); 40 assertEquals("any", two.simpleMethod("two again")); 42 assertEquals(null, three.simpleMethod("three")); 43 assertEquals(null, three.simpleMethod("three again")); 46 three.simpleMethod("test three again") [all...] |
/external/mockito/src/test/java/org/mockitousage/stacktrace/ |
PointingStackTraceToActualInvocationChunkInOrderTest.java | 40 mock.simpleMethod(1); 41 mock.simpleMethod(1); 44 mockTwo.simpleMethod(2); 45 mockTwo.simpleMethod(2); 48 mock.simpleMethod(3); 49 mock.simpleMethod(3); 52 mockTwo.simpleMethod(4); 53 mockTwo.simpleMethod(4); 58 inOrder.verify(mock, times(2)).simpleMethod(anyInt()); 59 inOrder.verify(mockTwo, times(2)).simpleMethod(anyInt()) [all...] |
PointingStackTraceToActualInvocationInOrderTest.java | 41 mock.simpleMethod(1); 44 mockTwo.simpleMethod(2); 47 mock.simpleMethod(3); 50 mockTwo.simpleMethod(4); 55 inOrder.verify(mock, atLeastOnce()).simpleMethod(anyInt()); 56 inOrder.verify(mockTwo).simpleMethod(anyInt()); 59 inOrder.verify(mock).simpleMethod(999); 68 inOrder.verify(mock, atLeastOnce()).simpleMethod(anyInt()); 71 inOrder.verify(mockTwo).simpleMethod(999); 80 inOrder.verify(mock).simpleMethod(anyInt()) [all...] |
ModellingDescriptiveMessagesTest.java | 51 verify(mock).simpleMethod(); 56 mock.simpleMethod("blah"); 57 verify(mock).simpleMethod(); 62 mock.simpleMethod(); 63 verify(mock, times(2)).simpleMethod(); 68 mock.simpleMethod(); 69 mock.simpleMethod(); 70 verify(mock, times(1)).simpleMethod(); 75 mock.simpleMethod(); 79 inOrder.verify(mock).simpleMethod(); [all...] |
/external/mockito/src/test/java/org/mockito/internal/junit/ |
ArgMismatchFinderTest.java | 32 when(mock1.simpleMethod(1)).thenReturn("1"); 33 mock2.simpleMethod(2); //arg mismatch on different mock 45 when(mock1.simpleMethod(1)).thenReturn("1"); 58 when(mock1.simpleMethod(1)).thenReturn("1"); 59 mock1.simpleMethod(1); // stub used 60 mock1.simpleMethod(2); // no stubbing, but we don't want it to be reported, either 72 when(mock1.simpleMethod(1)).thenReturn("1"); 73 mock1.simpleMethod(2); 85 when(mock1.simpleMethod(1)).thenReturn("1"); 86 mock1.simpleMethod(2) [all...] |
/external/mockito/src/test/java/org/mockitousage/basicapi/ |
ResetInvocationsTest.java | 22 when(methods.simpleMethod()).thenReturn("return"); 24 methods.simpleMethod(); 25 verify(methods).simpleMethod(); 30 assertEquals("return", methods.simpleMethod()); 35 methods.simpleMethod(); 36 moarMethods.simpleMethod();
|
/external/mockito/src/test/java/org/mockitousage/performance/ |
LoadsOfMocksTest.java | 30 when(mock.simpleMethod(1)).thenReturn("one"); 31 when(mock.simpleMethod(2)).thenReturn("two"); 33 assertEquals("one", mock.simpleMethod(1)); 34 assertEquals("two", mock.simpleMethod(2)); 36 verify(mock).simpleMethod(1); 37 verify(mock).simpleMethod(2);
|
/external/mockito/src/test/java/org/mockitousage/junitrule/ |
StrictJUnitRuleTest.java | 29 mock.simpleMethod(); 30 verify(mock).simpleMethod(); 34 given(mock.simpleMethod(10)).willReturn("foo"); 35 mock.simpleMethod(10); 39 given(mock.simpleMethod(10)).willReturn("foo"); 40 mock.simpleMethod(10); 41 mock.simpleMethod(15); 49 given(mock.simpleMethod(10)).willReturn("foo"); 50 mock2.simpleMethod(10); 58 given(mock.simpleMethod(10)).willReturn("foo") [all...] |
/external/mockito/src/test/java/org/mockitousage/junitrunner/ |
StubbingWarningsJUnitRunnerTest.java | 64 when(mock.simpleMethod(1)).thenReturn("1"); 65 mock.simpleMethod(2); 73 when(mock.simpleMethod(1)).thenReturn("1"); 74 mock.simpleMethod(2); 83 when(mock.simpleMethod(1)).thenReturn("1"); 84 mock.simpleMethod(1); 93 when(mock.simpleMethod(1)).thenReturn("1"); // <- used 94 when(mock.simpleMethod(2)).thenReturn("2"); // <- unused 96 mock.simpleMethod(1); // <- not reported 97 mock.simpleMethod(3); // <- reporte [all...] |
StrictStubsRunnerTest.java | 44 when(mock.simpleMethod()).thenReturn(""); 47 when(mock.simpleMethod()).thenReturn(""); 50 when(mock.simpleMethod()).thenReturn(""); 51 mock.simpleMethod(); 60 when(mock.simpleMethod()).thenReturn(""); 61 mock.simpleMethod(); 64 when(mock.simpleMethod(10)).thenReturn(""); 65 mock.simpleMethod(20);
|
UnusedStubsExceptionMessageTest.java | 23 IMethods mock1 = when(mock(IMethods.class).simpleMethod(1)).thenReturn("1").getMock(); 24 IMethods mock2 = when(mock(IMethods.class).simpleMethod(2)).thenReturn("2").getMock(); 25 IMethods mock3 = when(mock(IMethods.class).simpleMethod(3)).thenReturn("3").getMock(); 29 assertEquals("1", mock1.simpleMethod(1)); 34 assertEquals(null, mock2.simpleMethod(200)); 35 assertEquals(null, mock3.simpleMethod(300));
|
/external/mockito/src/test/java/org/mockitousage/internal/junit/ |
UnusedStubbingsFinderTest.java | 39 mock1.simpleMethod(); 49 when(mock1.simpleMethod()).thenReturn("1"); 50 mock1.simpleMethod(); 60 when(mock1.simpleMethod()).thenReturn("1"); 69 when(mock1.simpleMethod(1)).thenReturn("1"); 70 when(mock2.simpleMethod(2)).thenReturn("2"); 71 when(mock2.simpleMethod(3)).thenReturn("3"); 73 mock2.simpleMethod(2); 80 assertEquals("[mock1.simpleMethod(1); stubbed with: [Returns: 1], mock2.simpleMethod(3); stubbed with: [Returns: 3]]" [all...] |
/external/mockito/src/test/java/org/mockito/internal/verification/ |
DefaultRegisteredInvocationsTest.java | 29 Invocation simpleMethod = new InvocationBuilder().simpleMethod().toInvocation(); 32 invocations.add(simpleMethod); 34 assertTrue(invocations.getAll().contains(simpleMethod));
|