Skip to content

Commit

Permalink
Added tests for Arabic
Browse files Browse the repository at this point in the history
  • Loading branch information
deanhume committed Oct 16, 2019
1 parent e6d021a commit 83e911d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/HtmlMinifier/v16/TestStore/1/testlog.manifest
Binary file not shown.
3 changes: 3 additions & 0 deletions HtmlMinifier.Tests/DataHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@ public static class DataHelpers
;

public static string CommentLineWithTripleSlashExpectedResult = "<div class=\"vertically-centered-big mb8\">\" <p class=\"font-default-plus semi-bold color-yellow8\">\" GroupName\" </p>\" </div>\"";

public static string Arabic = "@using System.Web.Optimization\r\n@model Test\r\n@section Styles\r\n{\r\n @Styles.Render(\"~/Css/Profile\")\r\n}\r\n\r\n@Html.Partial(\"ProfilesMenu\")\r\n\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <div class=\"data-block\">\r\n <span class=\"current-venue-header\" data-bind=\"text: currentVenue().VenueName\"></span>\r\n <div class=\"btn-group\" data-bind=\"visible: currentVenue().VenueId() != null\">هذه هي بعض معلومات الاختبار </div>\r\n </div>\r\n\t</div>\r\n</div>";
public static string ArabicResult = "@model Test \r\n@using System.Web.Optimization \r\n@section Styles { @Styles.Render(\"~/Css/Profile\") } @Html.Partial(\"ProfilesMenu\") <div class=\"row\"><div class=\"col-md-12\"><div class=\"data-block\"><span class=\"current-venue-header\" data-bind=\"text: currentVenue().VenueName\"></span><div class=\"btn-group\" data-bind=\"visible: currentVenue().VenueId() != null\">هذه هي بعض معلومات الاختبار </div></div></div></div>";
}
}
14 changes: 14 additions & 0 deletions HtmlMinifier.Tests/MinificationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,26 @@ public void TextLineAtSign_ShouldReplaceWithTextTags()
string minifiedHtml = StreamReaderExtension.MinifyHtmlCode(DataHelpers.WithAtSignText, noFeatures);
Assert.AreEqual(minifiedHtml, expectedResult);
}

[TestMethod]
public void CommentLineWithTripleSlash_ShouldBeRemoved()
{
string expectedResult = DataHelpers.CommentLineWithTripleSlashExpectedResult;
string minifiedHtml = StreamReaderExtension.MinifyHtmlCode(DataHelpers.CommentLineWithTripleSlash, noFeatures);
Assert.AreEqual(minifiedHtml, expectedResult);
}

[TestMethod]
public void MinifyContents_WithArabic_ShouldReturnCorrectly()
{
// Arrange
string expectedResult = DataHelpers.ArabicResult;

// Act
string minifiedHtml = StreamReaderExtension.MinifyHtmlCode(DataHelpers.Arabic, noFeatures);

// Assert
Assert.AreEqual(minifiedHtml, expectedResult);
}
}
}

0 comments on commit 83e911d

Please sign in to comment.