I'm working on my own html helper. And now I'd like to test it. The way I chose is using the RazorEngine library to compile razor code and check a result.
Well I've started with the sample like below:
string template = "<div>@Html.Raw('sdf')</div>";
Engine.Razor.AddTemplate("mytemplate", template);
var r = Engine.Razor.RunCompile("mytemplate");
But I've got the error in this case - Additional information: Errors while compiling a Template.
I've found this question RazorEngine issues with @Html. But it looks too old.