public void ExtractQuery_NonExistingReport_CorrectExceptionReturned() { var request = new NBi.Core.Report.ReportDataSetRequest( string.Empty , ReportFileDirectory , "Not Existing" , "DataSet1" ); var parser = new FileReportingParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractCommand(request)); Assert.That(ex.Message, Does.Contain("No report found")); }
public void ExtractQuery_NonExistingDataSetOneExisting_CorrectExceptionReturned() { var request = new ReportDataSetRequest( string.Empty , ReportFileDirectory , "Currency_List" , "Non Existing" ); var parser = new FileReportingParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractCommand(request)); Assert.That(ex.Message, Does.Contain("'Currency'")); }
public void ExtractQuery_NonExistingDataSetMoreThanOneExisting_CorrectExceptionReturned() { var request = new NBi.Core.Report.ReportDataSetRequest( string.Empty , ReportFileDirectory , "Currency_Rates" , "Non Existing" ); var parser = new FileReportingParser(); var ex = Assert.Throws <ArgumentException>(() => parser.ExtractCommand(request)); Assert.That(ex.Message, Is.StringContaining("DataSet1").And.StringContaining("DataSet2")); }
public void ExtractSProc_ExistingReport_CorrectSProcReturned() { var request = new NBi.Core.Report.ReportDataSetRequest( string.Empty , ReportFileDirectory , "Currency_List - SProc" , "Currency" ); var parser = new FileReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Is.EqualTo("usp_CurrencyGetAll")); Assert.That(query.CommandType, Is.EqualTo(CommandType.StoredProcedure)); }
public void ExtractQuery_ExistingSharedDataSet_CorrectQueryReturned() { var request = new SharedDatasetRequest( string.Empty , ReportFileDirectory , "SalesEmployees" ); var parser = new FileReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Does.Contain("SELECT").And .Contain("[Sales].[SalesPerson]").And .Contain("[HumanResources].[Employee]")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }
public void ExtractQuery_ExistingReportAndDataSet_CorrectQueryReturned() { var request = new ReportDataSetRequest( string.Empty , ReportFileDirectory , "Currency_List" , "Currency" ); var parser = new FileReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Does.Contain("SELECT").And .Contain("[CurrencyAlternateKey]").And .Contain("[DimCurrency]")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }
public void ExtractQuery_ExistingReportAndSharedDataSet_CorrectQueryReturned() { var request = new NBi.Core.Report.ReportDataSetRequest( string.Empty , ReportFileDirectory , "Employee_Sales_Summary" , "SalesEmployees2008R2" ); var parser = new FileReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Is.StringContaining("SELECT").And .StringContaining("[Sales].[SalesPerson]").And .StringContaining("[HumanResources].[Employee]")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }