Interface WriterDelegateTests
-
- All Known Subinterfaces:
WriterDelegateTests.AppendCharSequencePortionTests
,WriterDelegateTests.AppendCharSequenceTests
,WriterDelegateTests.AppendCharTests
,WriterDelegateTests.CloseTests
,WriterDelegateTests.FlushTests
,WriterDelegateTests.WriteCharArrayPortionTests
,WriterDelegateTests.WriteCharArrayTests
,WriterDelegateTests.WriteCharTests
,WriterDelegateTests.WriteStringPortionTests
,WriterDelegateTests.WriteStringTests
public interface WriterDelegateTests
- Author:
- Rob Spoor
-
-
Nested Class Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default String
contentToWrite()
Returns the content to write for most tests.String
expectedContent(String written)
Returns the expected content written to a delegate, based on the content that was written to acreated writer
.default String
longContentToWrite()
Returns the content to write when testing writing large pieces of text.Writer
wrapWriter(Writer delegate)
Creates the writer to test.
-
-
-
Method Detail
-
wrapWriter
Writer wrapWriter(Writer delegate)
Creates the writer to test.This method will be called only once for each test. This makes it possible to capture the writer to test and its delegate, and perform additional tests after the pre-defined test has finished.
- Parameters:
delegate
- The delegate to test against.- Returns:
- The created writer.
-
expectedContent
String expectedContent(String written)
Returns the expected content written to a delegate, based on the content that was written to acreated writer
.- Parameters:
written
- The content that was written.- Returns:
- The expected content.
-
contentToWrite
default String contentToWrite()
Returns the content to write for most tests. This default implementation returns a lorem ipsum text.- Returns:
- The content to write.
-
longContentToWrite
default String longContentToWrite()
Returns the content to write when testing writing large pieces of text. this default implementation returnscontentToWrite()
concatenated1000
times.- Returns:
- The content to write when testing writing large pieces of text.
-
-