G
Guest
Hi all
I've read the thread titled: ""faking" an HTTPContext when running unit tests
http://communities2.microsoft.com/c...spnet&mid=a884a918-b04a-4912-b2ea-e691dc5230f
However, the solutions provided don't work for me
I have a class like this
public class MyClas
public static string Foo(string s
return HttpContext.Current.Server.HtmlEncode(s)
When I call MyClass.Foo() from within an executing request, it works. But when I call MyClass.Foo() from within an NUnit test, it fails because there is no HttpContext
Does anyone know how I can write a test for MyClass.Foo()
Like I said, I've tried the solutions from that other related thread, but none of them work
Thanks
Steven
I've read the thread titled: ""faking" an HTTPContext when running unit tests
http://communities2.microsoft.com/c...spnet&mid=a884a918-b04a-4912-b2ea-e691dc5230f
However, the solutions provided don't work for me
I have a class like this
public class MyClas
public static string Foo(string s
return HttpContext.Current.Server.HtmlEncode(s)
When I call MyClass.Foo() from within an executing request, it works. But when I call MyClass.Foo() from within an NUnit test, it fails because there is no HttpContext
Does anyone know how I can write a test for MyClass.Foo()
Like I said, I've tried the solutions from that other related thread, but none of them work
Thanks
Steven