我做了一个帮手如何测试辅助方法?
public static class UrlHelperExtension
{
public static string GetContent(this UrlHelper url, string link, bool breakCache = true)
{
// stuff
}
}
如何在单元测试测试吗?
[TestClass]
public class HelperTestSet
{
[TestMethod]
public void GetContentUrl()
{
// What do I need to do here?
// I need a RequestContext to create a new UrlHelper
// Which is the simplest way to test it?
}
}
如何创建试验所需的帮手?