コード例 #1
0
ファイル: FileReportingParserTest.cs プロジェクト: ywscr/NBi
        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"));
        }
コード例 #2
0
ファイル: FileReportingParserTest.cs プロジェクト: ywscr/NBi
        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'"));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
ファイル: FileReportingParserTest.cs プロジェクト: ywscr/NBi
        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));
        }
コード例 #5
0
ファイル: FileReportingParserTest.cs プロジェクト: ywscr/NBi
        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));
        }
コード例 #6
0
ファイル: FileReportingParserTest.cs プロジェクト: ywscr/NBi
        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));
        }
コード例 #7
0
        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));
        }