I realize that it may be a bad idea, but has anyone had success mocking HttpContext?
When I run the following code:
HttpContext mockHttpContext = (HttpContext)RecorderManager.CreateMockedObject(typeof(HttpContext));
I get the following exception:
failed: System.Reflection.AmbiguousMatchException : Ambiguous match found.
at System.DefaultBinder.BindToMethod(BindingFlags bindingAttr, MethodBase[] match, Object[]& args, ParameterModifier[] modifiers, CultureInfo cultureInfo, String[] names, Object& state)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at TypeMock.MockManager.MockObject(Type type, Constructor mockConstructors, Object[] args)
at TypeMock.MockManager.MockObject(Type type, Object[] args)
at TypeMock.RecorderManager.CreateMockedObject(Type typeToMock)
Any ideas?
- Michael