1919
2020import org .junit .jupiter .api .Test ;
2121import walkingkooka .HashCodeEqualsDefinedTesting2 ;
22- import walkingkooka .ToStringTesting ;
2322import walkingkooka .collect .list .Lists ;
24- import walkingkooka .reflect .ClassTesting2 ;
25- import walkingkooka .reflect .JavaVisibility ;
2623import walkingkooka .spreadsheet .format .provider .SpreadsheetFormatterSelectorToken ;
2724import walkingkooka .tree .text .TextNode ;
2825
3330import static org .junit .jupiter .api .Assertions .assertSame ;
3431import static org .junit .jupiter .api .Assertions .assertThrows ;
3532
36- public final class ToStringSpreadsheetFormatterTest implements SpreadsheetFormatterTesting2 <ToStringSpreadsheetFormatter >,
37- HashCodeEqualsDefinedTesting2 <ToStringSpreadsheetFormatter >,
38- ToStringTesting <ToStringSpreadsheetFormatter >,
39- ClassTesting2 <ToStringSpreadsheetFormatter > {
33+ public final class SpreadsheetFormatterSharedToStringTest extends SpreadsheetFormatterSharedTestCase <SpreadsheetFormatterSharedToString >
34+ implements HashCodeEqualsDefinedTesting2 <SpreadsheetFormatterSharedToString > {
4035
4136 private final static List <SpreadsheetFormatterSelectorToken > TOKENS = Lists .of (
4237 SpreadsheetFormatterSelectorToken .with (
@@ -83,7 +78,7 @@ public String toString() {
8378 public void testWithNullFormatterFails () {
8479 assertThrows (
8580 NullPointerException .class ,
86- () -> ToStringSpreadsheetFormatter .with (
81+ () -> SpreadsheetFormatterSharedToString .with (
8782 null ,
8883 TO_STRING
8984 )
@@ -94,7 +89,7 @@ public void testWithNullFormatterFails() {
9489 public void testWithNullToStringFails () {
9590 assertThrows (
9691 NullPointerException .class ,
97- () -> ToStringSpreadsheetFormatter .with (
92+ () -> SpreadsheetFormatterSharedToString .with (
9893 FORMATTER ,
9994 null
10095 )
@@ -105,7 +100,7 @@ public void testWithNullToStringFails() {
105100 public void testWithToStringSameToString () {
106101 assertSame (
107102 FORMATTER ,
108- ToStringSpreadsheetFormatter .with (
103+ SpreadsheetFormatterSharedToString .with (
109104 FORMATTER ,
110105 FORMATTER .toString ()
111106 )
@@ -114,10 +109,10 @@ public void testWithToStringSameToString() {
114109
115110 @ Test
116111 public void testWithToStringSameToString2 () {
117- final ToStringSpreadsheetFormatter formatter = this .createFormatter ();
112+ final SpreadsheetFormatterSharedToString formatter = this .createFormatter ();
118113 assertSame (
119114 formatter ,
120- ToStringSpreadsheetFormatter .with (
115+ SpreadsheetFormatterSharedToString .with (
121116 formatter ,
122117 formatter .toString ()
123118 )
@@ -126,11 +121,11 @@ public void testWithToStringSameToString2() {
126121
127122 @ Test
128123 public void testWithToStringSpreadsheetFormatterUnwraps () {
129- final ToStringSpreadsheetFormatter formatter = this .createFormatter ();
124+ final SpreadsheetFormatterSharedToString formatter = this .createFormatter ();
130125
131126 assertSame (
132127 formatter ,
133- ToStringSpreadsheetFormatter .with (
128+ SpreadsheetFormatterSharedToString .with (
134129 formatter ,
135130 FORMATTER .toString ()
136131 )
@@ -155,9 +150,9 @@ public void testTokens() {
155150 }
156151
157152 @ Override
158- public ToStringSpreadsheetFormatter createFormatter () {
159- return (ToStringSpreadsheetFormatter )
160- ToStringSpreadsheetFormatter .with (
153+ public SpreadsheetFormatterSharedToString createFormatter () {
154+ return (SpreadsheetFormatterSharedToString )
155+ SpreadsheetFormatterSharedToString .with (
161156 FORMATTER ,
162157 TO_STRING
163158 );
@@ -178,7 +173,7 @@ public Object value() {
178173 @ Test
179174 public void testEqualsDifferentFormatter () {
180175 this .checkNotEquals (
181- ToStringSpreadsheetFormatter .with (
176+ SpreadsheetFormatterSharedToString .with (
182177 SpreadsheetFormatters .fake (),
183178 TO_STRING
184179 )
@@ -188,15 +183,15 @@ public void testEqualsDifferentFormatter() {
188183 @ Test
189184 public void testEqualsDifferentToString () {
190185 this .checkNotEquals (
191- ToStringSpreadsheetFormatter .with (
186+ SpreadsheetFormatterSharedToString .with (
192187 FORMATTER ,
193188 "DifferentToString"
194189 )
195190 );
196191 }
197192
198193 @ Override
199- public ToStringSpreadsheetFormatter createObject () {
194+ public SpreadsheetFormatterSharedToString createObject () {
200195 return this .createFormatter ();
201196 }
202197
@@ -216,20 +211,15 @@ public void testToString() {
216211 public void testTreePrintable () {
217212 this .treePrintAndCheck (
218213 this .createFormatter (),
219- "ToStringSpreadsheetFormatter \n " +
220- " TestSpreadsheetFormatter (walkingkooka.spreadsheet.format.ToStringSpreadsheetFormatterTest $1)\n "
214+ "SpreadsheetFormatterSharedToString \n " +
215+ " TestSpreadsheetFormatter (walkingkooka.spreadsheet.format.SpreadsheetFormatterSharedToStringTest $1)\n "
221216 );
222217 }
223218
224219 // Class............................................................................................................
225220
226221 @ Override
227- public Class <ToStringSpreadsheetFormatter > type () {
228- return ToStringSpreadsheetFormatter .class ;
229- }
230-
231- @ Override
232- public JavaVisibility typeVisibility () {
233- return JavaVisibility .PACKAGE_PRIVATE ;
222+ public Class <SpreadsheetFormatterSharedToString > type () {
223+ return SpreadsheetFormatterSharedToString .class ;
234224 }
235225}
0 commit comments