This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not generate html folds in ASP.NET for elements that exist on a si…
…ngle line.
- Loading branch information
Showing
8 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/AddIns/BackendBindings/AspNet.Mvc/Test/Src/Folding/HtmlReaderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) | ||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) | ||
|
||
using System; | ||
using ICSharpCode.AspNet.Mvc.Folding; | ||
using NUnit.Framework; | ||
|
||
namespace AspNet.Mvc.Tests.Folding | ||
{ | ||
[TestFixture] | ||
public class HtmlReaderTests | ||
{ | ||
HtmlReader reader; | ||
|
||
void CreateReader(string html) | ||
{ | ||
reader = new HtmlReader(html); | ||
} | ||
|
||
[Test] | ||
public void Line_ReadParagraphStartTagOnFirstLine_ReturnsOne() | ||
{ | ||
CreateReader("<p>"); | ||
reader.Read(); | ||
|
||
int line = reader.Line; | ||
|
||
Assert.AreEqual(1, line); | ||
} | ||
|
||
[Test] | ||
public void Line_ReadParagraphEndTagOnSecondLine_ReturnsTwo() | ||
{ | ||
string html = | ||
"<p>\r\n" + | ||
"</p>\r\n"; | ||
|
||
CreateReader(html); | ||
reader.Read(); | ||
reader.Read(); | ||
|
||
int line = reader.Line; | ||
|
||
Assert.AreEqual(2, line); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters