Exemplo n.º 1
0
        public void FileResultTest()
        {
            // Arrange - create the controller
            ExampleController target = new ExampleController();

            // Act - call the action method
            FileResult result = target.AnnualReport();

            // Assert - check the result
            Assert.AreEqual(@"c:\AnnualReport.pdf", ((FilePathResult)result).FileName);
            Assert.AreEqual("application/pdf", result.ContentType);
            Assert.AreEqual("AnnualReport2011.pdf", result.FileDownloadName);
        }