2323import java .io .Writer ;
2424
2525import org .junit .jupiter .api .BeforeEach ;
26+ import org .junit .jupiter .api .Disabled ;
2627import org .junit .jupiter .api .Test ;
2728
2829/**
@@ -41,8 +42,34 @@ public void setUp() {
4142 }
4243
4344 @ Test
44- public void testWriteInt () {
45- assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .write (1 )));
45+ public void testAppendChar () {
46+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .append ('1' )));
47+ }
48+
49+ @ Test
50+ public void testAppendCharSequence () {
51+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .append ("01" )));
52+ }
53+
54+ @ Test
55+ public void testAppendCharSequenceIndexed () {
56+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .append ("01" , 0 , 1 )));
57+ }
58+
59+ @ Test
60+ public void testClose () {
61+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .close ()));
62+ }
63+
64+ @ Test
65+ public void testFlush () {
66+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .flush ()));
67+ }
68+
69+ @ Test
70+ @ Disabled ("What should happen here?" )
71+ public void testToString () {
72+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .toString ()));
4673 }
4774
4875 @ Test
@@ -56,13 +83,18 @@ public void testWriteCharArrayIndexed() {
5683 }
5784
5885 @ Test
59- public void testFlush () {
60- assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .flush ( )));
86+ public void testWriteInt () {
87+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .write ( 1 )));
6188 }
6289
6390 @ Test
64- public void testClose () {
65- assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .close ()));
91+ public void testWriteString () {
92+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .write ("01" )));
93+ }
94+
95+ @ Test
96+ public void testWriteStringIndexed () {
97+ assertEquals (exception , assertThrows (IOException .class , () -> brokenWriter .write ("01" , 0 , 1 )));
6698 }
6799
68100}
0 commit comments