public void ExtractQuery_NonExistingSharedDataSet_CorrectQuery() { var request = new ReportDataSetRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "Employee_Sales_Summary" , "NonExisting" ); var parser = new DatabaseReportingParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractCommand(request)); Assert.That(ex.Message, Does.Contain("Quota").And.StringContaining("EmpSalesMonth")); }
public void ExtractQuery_NonExistingDataSetOneExisting_CorrectExceptionReturned() { var request = new NBi.Core.Report.DatabaseRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "Currency_List" , "Non Existing" ); var parser = new DatabaseParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractQuery(request)); Assert.That(ex.Message, Is.StringContaining("'Currency_List'")); }
public void ExtractQuery_NonExistingSharedDataSet_CorrectQuery() { var request = new NBi.Core.Report.DatabaseRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks 2012/" , "Employee_Sales_Summary" , "NonExisting" ); var parser = new DatabaseParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractQuery(request)); Assert.That(ex.Message, Is.StringContaining("Quota").And.StringContaining("2008R2")); }
public void ExtractQuery_NonExistingReport_CorrectExceptionReturned() { var request = new ReportDataSetRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "Not Existing" , "DataSet1" ); var parser = new DatabaseReportingParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractCommand(request)); Assert.That(ex.Message, Is.StringContaining("No report found")); }
public void ExtractQuery_SharedDataSet_CorrectQuery() { var request = new SharedDatasetRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "EmpSalesMonth" ); var parser = new DatabaseReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Does.Contain("SELECT")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }
public void ExtractQuery_SharedDataSet_CorrectQuery() { var request = new NBi.Core.Report.DatabaseRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks 2012/" , "Employee_Sales_Summary" , "SalesEmployees2008R2" ); var parser = new DatabaseParser(); var query = parser.ExtractQuery(request); Assert.That(query, Is.StringContaining("SELECT")); }
public void ExtractQuery_ExistingReportAndDataSet_CorrectQueryReturned() { var request = new NBi.Core.Report.DatabaseRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "Currency_List" , "Currency" ); var parser = new DatabaseParser(); var query = parser.ExtractQuery(request); Assert.That(query, Is.StringContaining("SELECT").And .StringContaining("[CurrencyAlternateKey]").And .StringContaining("[DimCurrency]")); }