Пример #1
0
        public void GetFile()
        {
            var matrix = "11,12,13\n21,22,23\n31,32,33";
            HomeController controller = new HomeController(new SquareMatrixModel());
            var context = new MVCContextMocks(controller);
            context.Session["Matrix"] = matrix;

            //// Act
            FileContentResult result = controller.GetFile() as FileContentResult;

            //// Assert
            Assert.IsTrue(result.ContentType == "text/plain");
            Assert.IsTrue(Encoding.UTF8.GetString(result.FileContents) == matrix);
        }