|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ArgumentToStringTest | Line # 28 | 14 | 0% | 10 | 0 | 100% |
1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
(16) | |||
Result | |||
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_String
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Character
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Full
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_null
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Full
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_String
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_null
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Character
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Array
![]() |
1 PASS | |
0.20833333
|
org.easymock.tests.ArgumentToStringTest.testAppendArgument_Array
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentsToString
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentsToString
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentToString
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentToString
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentsToString_null
![]() |
1 PASS | |
0.125
|
org.easymock.tests.ArgumentToStringTest.testArgumentsToString_null
![]() |
1 PASS | |
1 | /** | |
2 | * Copyright 2001-2010 the original author or authors. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | package org.easymock.tests; | |
18 | ||
19 | import static org.junit.Assert.*; | |
20 | ||
21 | import org.easymock.internal.ArgumentToString; | |
22 | import org.junit.Before; | |
23 | import org.junit.Test; | |
24 | ||
25 | /** | |
26 | * @author Henri Tremblay | |
27 | */ | |
28 | public class ArgumentToStringTest { | |
29 | ||
30 | private StringBuffer buffer; | |
31 | ||
32 | 16 |
![]() |
33 | public void setUp() { | |
34 | 16 | buffer = new StringBuffer(); |
35 | } | |
36 | ||
37 | 2 |
![]() |
38 | public void testAppendArgument_null() { | |
39 | 2 | assertString("null", null); |
40 | } | |
41 | ||
42 | 2 |
![]() |
43 | public void testAppendArgument_String() { | |
44 | 2 | assertString("\"hello\"", "hello"); |
45 | } | |
46 | ||
47 | 2 |
![]() |
48 | public void testAppendArgument_Character() { | |
49 | 2 | assertString("'c'", Character.valueOf('c')); |
50 | } | |
51 | ||
52 | 2 |
![]() |
53 | public void testAppendArgument_Array() { | |
54 | 2 | assertString("[\"a\", \"b\"]", new String[] { "a", "b" }); |
55 | } | |
56 | ||
57 | 2 |
![]() |
58 | public void testAppendArgument_Full() { | |
59 | 2 | assertString("[3, 4, [\"a\", \"b\"], null]", new Object[] { 3, 4, new String[] { "a", "b" }, null }); |
60 | } | |
61 | ||
62 | 10 |
![]() |
63 | 10 | ArgumentToString.appendArgument(actual, buffer); |
64 | 10 | assertEquals(expected, buffer.toString()); |
65 | } | |
66 | ||
67 | 2 |
![]() |
68 | public void testArgumentToString() { | |
69 | 2 | final String actual = ArgumentToString.argumentToString(Boolean.TRUE); |
70 | 2 | assertEquals(Boolean.TRUE.toString(), actual); |
71 | } | |
72 | ||
73 | 2 |
![]() |
74 | public void testArgumentsToString() { | |
75 | 2 | final String actual = ArgumentToString.argumentsToString(Boolean.TRUE, Boolean.FALSE); |
76 | 2 | assertEquals("true, false", actual); |
77 | } | |
78 | ||
79 | 2 |
![]() |
80 | public void testArgumentsToString_null() { | |
81 | 2 | final String actual = ArgumentToString.argumentsToString((Object[]) null); |
82 | 2 | assertEquals("", actual); |
83 | } | |
84 | } |
|