public async Task ExportJson_RedirectToIndex() { Mock <PostService> mock = new Mock <PostService>(); PostController controller = GetNewPostControllerWithControllerContext(mock.Object, null, null); FilePathResult result = (await controller.ExportJson()) as FilePathResult; Assert.AreEqual("application/json", result.ContentType); Assert.AreEqual("Posts.json", result.FileDownloadName); Assert.AreEqual("./DiplomMSSQLApp.WEB/Results/Posts.json", result.FileName); }