-
-
Notifications
You must be signed in to change notification settings - Fork 724
Related to #2971 display names #3000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
112a13b
b9f23fa
677f24e
819c0a0
bc94223
bc288a5
23d887c
06cebe3
a5ba143
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||||||||||
import org.junit.jupiter.api.BeforeEach; | ||||||||||||||
import org.junit.jupiter.api.DisplayName; | ||||||||||||||
import org.junit.jupiter.api.Test; | ||||||||||||||
import org.junit.jupiter.api.Disabled; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Can you also move this up, so the imports are nicely arranged in a alphabetical order? |
||||||||||||||
|
||||||||||||||
|
@@ -13,6 +14,7 @@ public void setup() { | |||||||||||||
} | ||||||||||||||
|
||||||||||||||
@Test | ||||||||||||||
@DisplayName("Brown and black") | ||||||||||||||
public void testBrownAndBlack() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{"brown", "black"}) | ||||||||||||||
|
@@ -21,6 +23,7 @@ public void testBrownAndBlack() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("Blue and grey") | ||||||||||||||
public void testBlueAndGrey() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "blue", "grey" }) | ||||||||||||||
|
@@ -29,6 +32,7 @@ public void testBlueAndGrey() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("Yellow and violet") | ||||||||||||||
public void testYellowAndViolet() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "yellow", "violet" }) | ||||||||||||||
|
@@ -37,6 +41,7 @@ public void testYellowAndViolet() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("Orange and orange") | ||||||||||||||
public void testOrangeAndOrange() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "orange", "orange" }) | ||||||||||||||
|
@@ -45,6 +50,7 @@ public void testOrangeAndOrange() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("White and red") | ||||||||||||||
public void testWhiteAndRed() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "white", "red" }) | ||||||||||||||
|
@@ -53,6 +59,7 @@ public void testWhiteAndRed() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("Black and brown, one-digit") | ||||||||||||||
public void testBlackAndBrownOneDigit() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "black", "brown" }) | ||||||||||||||
|
@@ -61,6 +68,7 @@ public void testBlackAndBrownOneDigit() { | |||||||||||||
|
||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||
@Test | ||||||||||||||
@DisplayName("Ignore additional colors") | ||||||||||||||
public void testIgnoreAdditionalColors() { | ||||||||||||||
assertThat( | ||||||||||||||
resistorColorDuo.value(new String[]{ "green", "brown", "orange" }) | ||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||||||||||||||
import org.junit.jupiter.api.BeforeEach; | ||||||||||||||||||
import org.junit.jupiter.api.DisplayName; | ||||||||||||||||||
import org.junit.jupiter.api.Test; | ||||||||||||||||||
import org.junit.jupiter.api.Disabled; | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This one too! |
||||||||||||||||||
|
||||||||||||||||||
|
@@ -13,6 +14,7 @@ public void setup() { | |||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Orange and orange and black") | ||||||||||||||||||
public void testOrangeAndOrangeAndBlack() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"orange", "orange", "black"}) | ||||||||||||||||||
|
@@ -21,6 +23,7 @@ public void testOrangeAndOrangeAndBlack() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Blue and grey and brown") | ||||||||||||||||||
public void testBlueAndGreyAndBrown() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"blue", "grey", "brown"}) | ||||||||||||||||||
|
@@ -29,6 +32,7 @@ public void testBlueAndGreyAndBrown() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Red and black and red") | ||||||||||||||||||
public void testRedAndBlackAndRed() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"red", "black", "red"}) | ||||||||||||||||||
|
@@ -37,6 +41,7 @@ public void testRedAndBlackAndRed() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Green and brown and orange") | ||||||||||||||||||
public void testGreenAndBrownAndOrange() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"green", "brown", "orange"}) | ||||||||||||||||||
|
@@ -45,6 +50,7 @@ public void testGreenAndBrownAndOrange() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Yellow and violet and yellow") | ||||||||||||||||||
public void testYellowAndVioletAndYellow() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"yellow", "violet", "yellow"}) | ||||||||||||||||||
|
@@ -53,6 +59,7 @@ public void testYellowAndVioletAndYellow() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Blue and violet and blue") | ||||||||||||||||||
public void testBlueAndVioletAndBlue() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"blue", "violet", "blue"}) | ||||||||||||||||||
|
@@ -61,6 +68,7 @@ public void testBlueAndVioletAndBlue() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Minimum possible value") | ||||||||||||||||||
public void testBlackAndBlackAndBlack() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"black", "black", "black"}) | ||||||||||||||||||
|
@@ -69,6 +77,7 @@ public void testBlackAndBlackAndBlack() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Maximum possible value") | ||||||||||||||||||
public void testWhiteAndWhiteAndWhite() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"white", "white", "white"}) | ||||||||||||||||||
|
@@ -77,6 +86,7 @@ public void testWhiteAndWhiteAndWhite() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("First two colors make an invalid octal number") | ||||||||||||||||||
public void testFirstTwoColorsMakeAnInvalidOctalNumber() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"black", "grey", "black"}) | ||||||||||||||||||
|
@@ -85,6 +95,7 @@ public void testFirstTwoColorsMakeAnInvalidOctalNumber() { | |||||||||||||||||
|
||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||
@Test | ||||||||||||||||||
@DisplayName("Ignore extra colors") | ||||||||||||||||||
public void testIgnoreExtraColors() { | ||||||||||||||||||
assertThat( | ||||||||||||||||||
resistorColorTrio.label(new String[]{"blue", "green", "yellow", "orange"}) | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||||||||||||||||||||
import org.junit.jupiter.api.BeforeEach; | ||||||||||||||||||||||||
import org.junit.jupiter.api.DisplayName; | ||||||||||||||||||||||||
import org.junit.jupiter.api.Test; | ||||||||||||||||||||||||
import org.junit.jupiter.api.Disabled; | ||||||||||||||||||||||||
import static org.assertj.core.api.Assertions.assertThat; | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
|
@@ -13,24 +14,28 @@ public void setup() { | |||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
@Test | ||||||||||||||||||||||||
@DisplayName("Black") | ||||||||||||||||||||||||
public void testBlackColorCode() { | ||||||||||||||||||||||||
assertThat(resistorColor.colorCode("black")).isEqualTo(0); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||||||||
@Test | ||||||||||||||||||||||||
@DisplayName("white") | ||||||||||||||||||||||||
public void testWhiteColorCode() { | ||||||||||||||||||||||||
assertThat(resistorColor.colorCode("white")).isEqualTo(9); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||||||||
@Test | ||||||||||||||||||||||||
@DisplayName("Orange") | ||||||||||||||||||||||||
public void testOrangeColorCode() { | ||||||||||||||||||||||||
assertThat(resistorColor.colorCode("orange")).isEqualTo(3); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
@Disabled("Remove to run test") | ||||||||||||||||||||||||
@Test | ||||||||||||||||||||||||
@DisplayName("Colors") | ||||||||||||||||||||||||
public void testColors() { | ||||||||||||||||||||||||
assertThat(resistorColor.colors()).containsExactly( | ||||||||||||||||||||||||
"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white" | ||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will fix the checkstyle error. The line length needs to be under 120 characters, which is why the tests were failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching this! I've fixed the long display name by breaking it into multiple lines as suggested.
The checkstyle error should now be resolved. Thanks for the guidance!