EasyMock 2.3

Clover coverage report - EasyMock 2.3
Coverage timestamp: mar. juil. 10 2007 02:46:04 CEST
FRAMES NO FRAMES

file stats: | LOC: | 36 |  | Methods: | 4
| NCLOC: | 25 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

Same.java

100%

100%

100%

100%

1 |  | /*
2 |  | * Copyright (c) 2001-2007 OFFIS, Tammo Freese.
3 |  | * This program is made available under the terms of the MIT License.
4 |  | */
5 |  | package org.easymock.internal.matchers;
6 |  |
7 |  | import org.easymock.IArgumentMatcher;
8 |  |
9 |  | public class Same implements IArgumentMatcher {
10 |  |
11 |  | private final Object expected;
12 |  |
13 | 5 | public Same(Object expected) {
14 | 5 | this.expected = expected;
15 |  | }
16 |  |
17 | 4 | public boolean matches(Object actual) {
18 | 4 | return expected == actual;
19 |  | }
20 |  |
21 | 3 | public void appendTo(StringBuffer buffer) {
22 | 3 | buffer.append("same(");
23 | 3 | appendQuoting(buffer);
24 | 3 | buffer.append(expected);
25 | 3 | appendQuoting(buffer);
26 | 3 | buffer.append(")");
27 |  | }
28 |  |
29 | 6 | private void appendQuoting(StringBuffer buffer) {
30 | 6 | if (expected instanceof String) {
31 | 2 | buffer.append("\"");
32 | 4 | } else if (expected instanceof Character) {
33 | 2 | buffer.append("'");
34 |  | }
35 |  | }
36 |  | }