Skip to content

Commit

Permalink
Added the start of a unit test for issue #580
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Jun 9, 2020
1 parent 6bd65a4 commit 578a230
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions UnitTests/Text/TextToFlowedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,44 @@ public void TestSpaceStuffingLinesStartingWithSpace ()

Assert.AreEqual (text, result);
}

[Test]
public void TestFlowingLongLines ()
{
string text = "But, soft! what light through yonder window breaks? " +
"It is the east, and Juliet is the sun. " +
"Arise, fair sun, and kill the envious moon, " +
"Who is already sick and pale with grief, " +
"That thou her maid art far more fair than she: " +
"Be not her maid, since she is envious; " +
"Her vestal livery is but sick and green " +
"And none but fools do wear it; cast it off. " +
"It is my lady, O, it is my love! " +
"O, that she knew she were! " +
"She speaks yet she says nothing: what of that? " +
"Her eye discourses; I will answer it. " +
"I am too bold, 'tis not to me she speaks: " +
"Two of the fairest stars in all the heaven, " +
"Having some business, do entreat her eyes " +
"To twinkle in their spheres till they return. " +
"What if her eyes were there, they in her head? " +
"The brightness of her cheek would shame those stars, " +
"As daylight doth a lamp; her eyes in heaven " +
"Would through the airy region stream so bright " +
"That birds would sing and think it were not night. " +
"See, how she leans her cheek upon her hand! " +
"O, that I were a glove upon that hand, " +
"That I might touch that cheek!" + Environment.NewLine;
const string expected = "";
TextConverter converter = new TextToFlowed ();
string result = converter.Convert (text);

Assert.AreEqual (expected, result);

converter = new FlowedToText ();
result = converter.Convert (expected);

Assert.AreEqual (text, result);
}
}
}

0 comments on commit 578a230

Please sign in to comment.