public void Can_export_report_data() { // Arrange PlayerTestHelper.CreatePlayer(); var filteredRecords = ReportController.FilterAndOrder( _reportQueries.GetPlayerRecordsForExport(), new PlayerRecord(), "RegistrationDate", "asc"); // Act var content = Encoding.Unicode.GetString(ReportController.ExportToExcel(filteredRecords)); // Assert Assert.AreNotEqual(content.IndexOf("<table"), -1); }
public ActionResult ExportPlayerReport(PlayerRecord filters, string sortColumnName, string sortOrder, string hiddenColumns = null) { var allowViewEmail = _authQueries.VerifyPermission(UserId, Permissions.ViewEmail, Modules.PlayerReport); var allowViewMobile = _authQueries.VerifyPermission(UserId, Permissions.ViewMobile, Modules.PlayerReport); if (!allowViewEmail) { hiddenColumns = "Email"; } if (!allowViewMobile) { hiddenColumns = "Mobile"; } if (!allowViewEmail && !allowViewMobile) { hiddenColumns = "Email,Mobile"; } return(ExportReport(_queries.GetPlayerRecordsForExport(), filters, sortColumnName, sortOrder, hiddenColumns)); }
public void Cannot_execute_ReportQueries_without_permissions() { // Arrange LogWithNewAdmin(Modules.PlayerManager, Permissions.Update); // Act Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetAdminActivityLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetAdminAuthenticationLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetMemberAuthenticationLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerBetHistoryRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerBetHistoryRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetDepositRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetDepositRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetBrandRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetBrandRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetLicenseeRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetLicenseeRecordsForExport()); //Assert.Throws<InsufficientPermissionsException>(() => _reportQueries.GetLanguageRecords()); //Assert.Throws<InsufficientPermissionsException>(() => _reportQueries.GetLanguageRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetVipLevelRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetVipLevelRecordsForExport()); }