Skip to content

Commit

Permalink
Enable HtmlHelperExtensionTests for .NET Core
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinsoftware committed Jul 14, 2019
1 parent 4cfd755 commit c624092
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/React.Tests/Mvc/HtmlHelperExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
* LICENSE file in the root directory of this source tree.
*/
#if NET452
using React.Web.Mvc;
#else
using React.AspNet;
#endif

using System;
using System.IO;
using System.Security.Cryptography;
using Moq;
using React.Web.Mvc;
using Xunit;

namespace React.Tests.Mvc
Expand Down Expand Up @@ -269,4 +272,3 @@ public void RenderFunctionsCalledNonLazily()
}
}
}
#endif
21 changes: 21 additions & 0 deletions tests/React.Tests/Mvc/TestUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#if !NET452
using System.IO;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Html;

namespace React.Tests.Mvc
{
public static class TestUtilities
{
public static string ToHtmlString(this IHtmlContent source)
{
using (var writer = new StringWriter())
{
source.WriteTo(writer, HtmlEncoder.Default);
return writer.ToString();
}
}
}
}

#endif

0 comments on commit c624092

Please sign in to comment.