Tell me more ×  var mockedService = new Mock();
mockedService.Setup(x =>
x.InterfaceMethod(args)).Returns(value); _Service =
mockedService.Object; MyController controller =new
MyController(_Service);  var result =
(ViewResult)controller.Foo();  Now this Foo() Method contains
the Following API Call   But the HTTPContext is null, as i'm
just unit testing , i have not Authenticated. and hence not
populated the HTTPContext Object.  I cant set expectations on
this class because the HTTPContext is sealed.  I've been
searching in the net , but there were only samples to fake the
HTTPContextBase  Now how do i get my Unit Test to Pass. Any
Suggestions.?  thanks ,   share|improve this question There is
definitely something wrong with the second code chunk... –  Max
Galkin Sep 21 '09 at 9:37 I mean, first you make a new
controller instance and the next line throws it away by re-
assigning the controller variable. –  Max Galkin Sep 21 '09 at
9:38 In the second code snippet, why are you assigning to the
controller variable