Skip to content

Commit

Permalink
Added the expected result to the unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Jun 9, 2020
1 parent 578a230 commit b4a92eb
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions UnitTests/Text/TextToFlowedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,36 @@ public void TestFlowingLongLines ()
"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 = "";
string expected = "But, soft! what light through yonder window breaks? " +
"It is the east, " + Environment.NewLine + " and Juliet is the sun. " +
"Arise, fair sun, and kill the envious moon, " + Environment.NewLine + " " +
"Who is already sick and pale with grief, " +
"That thou her maid art far " + Environment.NewLine + " more fair than she: " +
"Be not her maid, since she is envious; " +
"Her vestal " + Environment.NewLine + " livery is but sick and green " +
"And none but fools do wear it; cast " + Environment.NewLine + "it off. " + // this looks like a bug
"It is my lady, O, it is my love! " +
"O, that she knew she were! " + Environment.NewLine + " " +
"She speaks yet she says nothing: what of that? " +
"Her eye discourses; " + Environment.NewLine + " I will answer it. " +
"I am too bold, 'tis not to me she speaks: " +
"Two of " + Environment.NewLine + " the fairest stars in all the heaven, " +
"Having some business, do entreat " + Environment.NewLine + " her eyes " +
"To twinkle in their spheres till they return. " +
"What if her " + Environment.NewLine + " eyes were there, they in her head? " +
"The brightness of her cheek would " + Environment.NewLine + " shame those stars, " +
"As daylight doth a lamp; her eyes in heaven " +
"Would " + Environment.NewLine + " through the airy region stream so bright " +
"That birds would sing and " + Environment.NewLine + " think it were not night. " +
"See, how she leans her cheek upon her hand! " + Environment.NewLine + " " +
"O, that I were a glove upon that hand, " +
"That I might touch that cheek!" + Environment.NewLine;
TextConverter converter = new TextToFlowed ();
string result = converter.Convert (text);

Assert.AreEqual (expected, result);

converter = new FlowedToText ();
converter = new FlowedToText (); // { DeleteSpace = true };
result = converter.Convert (expected);

Assert.AreEqual (text, result);
Expand Down

0 comments on commit b4a92eb

Please sign in to comment.