public void FeatureArticle_Given_ReturnFeatureBlogToView() { //Arrange var fixture = new Fixture().Customize(new AutoMoqCustomization()); fixture.Customize <ControllerContext>(c => c.Without(x => x.DisplayMode)); List <BlogViewModel> blogViewModelDummy = fixture.CreateMany <BlogViewModel>().ToList(); ISearchContextManager df = Substitute.For <ISearchContextManager>(); var mockScMrg = fixture.Freeze <Mock <ISearchContextManager> >(); mockScMrg.Setup(r => r.GetBlogs(Arg.Any <SearchQuery>(), Arg.Any <bool>())).Returns(blogViewModelDummy); BlogController blgController = fixture.Freeze <BlogController>(); HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)); ControllerContext contextItem = new ControllerContext( new RequestContext(), blgController); blgController.ControllerContext = contextItem; //Act var result = blgController.FeaturedArticle() as ViewResult; //assert result.ViewName.Should().Be(Constants.FeaturedArticle); }