Skip to content

Commit c624092

Browse files
Enable HtmlHelperExtensionTests for .NET Core
1 parent 4cfd755 commit c624092

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

tests/React.Tests/Mvc/HtmlHelperExtensionsTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77
#if NET452
8+
using React.Web.Mvc;
9+
#else
10+
using React.AspNet;
11+
#endif
812

913
using System;
1014
using System.IO;
1115
using System.Security.Cryptography;
1216
using Moq;
13-
using React.Web.Mvc;
1417
using Xunit;
1518

1619
namespace React.Tests.Mvc
@@ -269,4 +272,3 @@ public void RenderFunctionsCalledNonLazily()
269272
}
270273
}
271274
}
272-
#endif
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#if !NET452
2+
using System.IO;
3+
using System.Text.Encodings.Web;
4+
using Microsoft.AspNetCore.Html;
5+
6+
namespace React.Tests.Mvc
7+
{
8+
public static class TestUtilities
9+
{
10+
public static string ToHtmlString(this IHtmlContent source)
11+
{
12+
using (var writer = new StringWriter())
13+
{
14+
source.WriteTo(writer, HtmlEncoder.Default);
15+
return writer.ToString();
16+
}
17+
}
18+
}
19+
}
20+
21+
#endif

0 commit comments

Comments
 (0)