public void Export_DownloadQnA() { Core.Services.IExportService <Export.Settings.QnAMakerSetting> exportService = new Export.ExportServiceImpl <Export.Settings.QnAMakerSetting>(); var controller = new Wispero.Web.Controllers.ListingController(queryService.Object, exportService); var result = controller.ExportQnAMaker(string.Empty, AppDomain.CurrentDomain.BaseDirectory); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(FileResult)); var fileResult = result as FileResult; Assert.IsTrue(fileResult.ContentType == "application/text"); }
public void Index_LoadingPageWithTag() { var controller = new Wispero.Web.Controllers.ListingController(queryService.Object, null); var viewResult = controller.Index(tag: "Tag1"); Assert.IsNotNull(viewResult); Assert.IsInstanceOfType(viewResult, typeof(ViewResult)); var model = ((ViewResult)viewResult).Model as Models.ListingViewModel; Assert.IsFalse(string.IsNullOrEmpty(model.Tag)); Assert.IsTrue(model.Questions.Count == 1); }