Skip to content

Commit

Permalink
Update unit tests for nested lists GH-14
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticmind committed Nov 21, 2017
1 parent 7a5b2aa commit dd004cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ReverseMarkdown.Test/ConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,16 @@ public void WhenThereIsOrderedList_ThenConvertToMarkdownList()
[Fact]
public void WhenThereIsOrderedListWithNestedUnorderedList_ThenConvertToMarkdownListWithNestedList()
{
const string html = @"This text has ordered list.<ol><li><ul><li>InnerItem1</li><li>InnerItem2</li></ul></li><li>Item2</li></ol>";
string expected = $"This text has ordered list.{Environment.NewLine}1. - InnerItem1{Environment.NewLine} - InnerItem2{Environment.NewLine}2. Item2{Environment.NewLine}{Environment.NewLine}";
const string html = @"This text has ordered list.<ol><li>OuterItem1<ul><li>InnerItem1</li><li>InnerItem2</li></ul></li><li>Item2</li></ol>";
string expected = $"This text has ordered list.{Environment.NewLine}1. OuterItem1{Environment.NewLine} - InnerItem1{Environment.NewLine} - InnerItem2{Environment.NewLine}2. Item2{Environment.NewLine}{Environment.NewLine}";
CheckConversion(html, expected);
}

[Fact]
public void WhenThereIsUnorderedListWithNestedOrderedList_ThenConvertToMarkdownListWithNestedList()
{
const string html = @"This text has ordered list.<ul><li><ol><li>InnerItem1</li><li>InnerItem2</li></ol></li><li>Item2</li></ul>";
string expected = $"This text has ordered list.{Environment.NewLine}- 1. InnerItem1{Environment.NewLine} 2. InnerItem2{Environment.NewLine}- Item2{Environment.NewLine}{Environment.NewLine}";
const string html = @"This text has ordered list.<ul><li>OuterItem1<ol><li>InnerItem1</li><li>InnerItem2</li></ol></li><li>Item2</li></ul>";
string expected = $"This text has ordered list.{Environment.NewLine}- OuterItem1{Environment.NewLine} 1. InnerItem1{Environment.NewLine} 2. InnerItem2{Environment.NewLine}- Item2{Environment.NewLine}{Environment.NewLine}";
CheckConversion(html, expected);
}

Expand Down

0 comments on commit dd004cc

Please sign in to comment.