public void GetStockFile()
 {
     var manager = new StockManager();
     manager.ExtractStockFilesFromSites();
     var lstSstockFiles = manager.GetAllStockFiles();
     Assert.IsTrue(lstSstockFiles.Count > 0 && manager.GetStockFile(lstSstockFiles[0].Id.ToString()) != null);
 }
        public ActionResult ViewFiles(string stockFileId)
        {
            var manager = new StockManager();
            StockDetails stockDetails = new StockDetails();
            stockDetails.StockFilesViewModel = manager.GetStockFile(stockFileId);

            byte[] byteArray = Encoding.UTF8.GetBytes(stockDetails.StockFilesViewModel.File);
            FileTypeFactory fileFactory = new FileTypeFactory();
            FileType fileTypeClass = fileFactory.FileTypes(stockDetails.StockFilesViewModel.Format.ToLower());
            string fileType = fileTypeClass.GetFileType();
            return File(byteArray, fileType);
        }