public ActionResult ExportProductsToGoogleBaseInResponse() { try { var file = _googleBaseManager.ExportProductsToGoogleBase(); return(new FileStreamResult(new MemoryStream(file), "text/xml")); } catch (Exception ex) { CurrentRequestData.ErrorSignal.Raise(ex); const string msg = "Google Base exporting has failed. Please try again and contact system administration if error continues to appear."; return(RedirectToAction("Dashboard", "GoogleBase", new { status = msg })); } }
public ActionResult ExportProductsToGoogleBase() { try { var file = _googleBaseManager.ExportProductsToGoogleBase(); ViewBag.ExportStatus = "Products successfully exported."; return(File(file, "application/rss+xml", "MrCMS-GoogleBase-Products.xml")); } catch (Exception ex) { CurrentRequestData.ErrorSignal.Raise(ex); const string msg = "Google Base exporting has failed. Please try again and contact system administration if error continues to appear."; return(RedirectToAction("Dashboard", new { status = msg })); } }
public void GoogleBaseController_ExportProductsToGoogleBase_ShouldCallExportProductsToGoogleBaseOfGoogleBaseManager() { _googleBaseController.ExportProductsToGoogleBase(); A.CallTo(() => _googleBaseManager.ExportProductsToGoogleBase()).MustHaveHappened(); }