| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.fixture; |
| 17 |
|
|
| 18 |
|
import static org.fest.assertions.Assertions.assertThat; |
| 19 |
|
import static org.fest.swing.util.Colors.colorFromHexString; |
| 20 |
|
|
| 21 |
|
import java.awt.Color; |
| 22 |
|
|
| 23 |
|
import org.fest.assertions.BasicDescription; |
| 24 |
|
import org.fest.assertions.Description; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
@link |
| 28 |
|
|
| 29 |
|
@author |
| 30 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (27) |
Complexity: 11 |
Complexity Density: 0.79 |
|
| 31 |
|
public class ColorFixture { |
| 32 |
|
|
| 33 |
|
private final Color target; |
| 34 |
|
private final Description description; |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
@link |
| 38 |
|
@param |
| 39 |
|
@throws |
| 40 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 41 |
12
|
public ColorFixture(Color target) {... |
| 42 |
12
|
this(target, (Description)null); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@link |
| 47 |
|
@param |
| 48 |
|
@param |
| 49 |
|
@throws |
| 50 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 51 |
5
|
public ColorFixture(Color target, String description) {... |
| 52 |
5
|
this(target, new BasicDescription(description)); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
@link |
| 57 |
|
@param |
| 58 |
|
@param |
| 59 |
|
@throws |
| 60 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 61 |
22
|
public ColorFixture(Color target, Description description) {... |
| 62 |
1
|
if (target == null) throw new NullPointerException("The given color should not be null"); |
| 63 |
21
|
this.target = target; |
| 64 |
21
|
this.description = description; |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
@param |
| 71 |
|
@return |
| 72 |
|
@throws |
| 73 |
|
@throws |
| 74 |
|
@throws |
| 75 |
|
@throws |
| 76 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
3
|
public ColorFixture requireEqualTo(String hexValue) {... |
| 78 |
3
|
return requireEqualTo(colorFromHexString(hexValue)); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
@param |
| 84 |
|
@return |
| 85 |
|
@throws |
| 86 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 87 |
6
|
public ColorFixture requireEqualTo(Color color) {... |
| 88 |
6
|
assertThat(target).as(description).isEqualTo(color); |
| 89 |
2
|
return this; |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
@param |
| 96 |
|
@return |
| 97 |
|
@throws |
| 98 |
|
@throws |
| 99 |
|
@throws |
| 100 |
|
@throws |
| 101 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 102 |
3
|
public ColorFixture requireNotEqualTo(String hexValue) {... |
| 103 |
3
|
return requireNotEqualTo(colorFromHexString(hexValue)); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
@param |
| 109 |
|
@return |
| 110 |
|
@throws |
| 111 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 112 |
6
|
public ColorFixture requireNotEqualTo(Color color) {... |
| 113 |
6
|
assertThat(target).as(description).isNotEqualTo(color); |
| 114 |
2
|
return this; |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
@return |
| 120 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 121 |
4
|
public Color target() { return target; }... |
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
@return |
| 126 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 127 |
6
|
public final String description() { return description != null ? description.value() : null; }... |
| 128 |
|
} |