public void ExecuteResult_Should_Write_Atom() { var controllerContext = new ControllerContext(_httpContext.Object, new RouteData(), new Mock <ControllerBase>().Object); _httpContext.HttpResponse.ExpectSet(r => r.ContentType).Verifiable(); _httpContext.HttpResponse.Expect(r => r.Write(It.IsAny <string>())).Verifiable(); FeedResult result = new FeedResult(feedViewData, "atom"); result.ExecuteResult(controllerContext); _httpContext.Verify(); }
public void ExecuteResult_Should_Write_Rss() { var controllerContext = new ControllerContext(_httpContext.Object, new RouteData(), new Mock <ControllerBase>().Object); _httpContext.HttpResponse.SetupSet(r => r.ContentType = "application/rss+xml").Verifiable(); _httpContext.HttpResponse.Setup(r => r.Write(It.IsAny <string>())).Verifiable(); FeedResult result = new FeedResult(feedViewData, "rss"); result.ExecuteResult(controllerContext); _httpContext.Verify(); }