File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
exercises/practice/largest-series-product Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 2222 " Smarticles101" ,
2323 " sonapraneeth-a" ,
2424 " sshine" ,
25+ " Xinri" ,
2526 " Zaldrick"
2627 ],
2728 "files" : {
Original file line number Diff line number Diff line change @@ -130,7 +130,29 @@ public void testSeriesLengthLongerThanLengthOfStringToTestIsRejected() {
130130 @ Disabled ("Remove to run test" )
131131 @ Test
132132 @ DisplayName ("reports 1 for empty string and empty product (0 span)" )
133- public void testEmptyStringToSearchAndSeriesOfNonZeroLengthIsRejected () {
133+ public void testEmptyStringToSearchAndEmptyProduct () {
134+ LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator ("" );
135+
136+ long actualProduct = calculator .calculateLargestProductForSeriesLength (0 );
137+
138+ assertThat (actualProduct ).isEqualTo (1 );
139+ }
140+
141+ @ Disabled ("Remove to run test" )
142+ @ Test
143+ @ DisplayName ("reports 1 for nonempty string and empty product (0 span)" )
144+ public void testNonEmptyStringToSearchAndEmptyProduct () {
145+ LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator ("123" );
146+
147+ long actualProduct = calculator .calculateLargestProductForSeriesLength (0 );
148+
149+ assertThat (actualProduct ).isEqualTo (1 );
150+ }
151+
152+ @ Disabled ("Remove to run test" )
153+ @ Test
154+ @ DisplayName ("rejects empty string and nonzero span" )
155+ public void testEmptyStringAndNonZeroSpanIsRejected () {
134156 LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator ("" );
135157
136158 assertThatExceptionOfType (IllegalArgumentException .class )
You can’t perform that action at this time.
0 commit comments