예제 #1
0
        public void ExtractQuery_NonExistingReport_CorrectExceptionReturned()
        {
            var request = new NBi.Core.Report.FileRequest(
                    ReportFileDirectory
                    , "Not Existing"
                    , "DataSet1"
                );

            var parser = new FileParser();
            var ex = Assert.Throws<ArgumentException>(() => parser.ExtractQuery(request));
            Assert.That(ex.Message, Is.StringContaining("No report found"));
        }
예제 #2
0
        public void ExtractQuery_NonExistingDataSetMoreThanOneExisting_CorrectExceptionReturned()
        {
            var request = new NBi.Core.Report.FileRequest(
                    ReportFileDirectory
                    , "Currency_Rates"
                    , "Non Existing"
                );

            var parser = new FileParser();
            var ex = Assert.Throws<ArgumentException>(() => parser.ExtractQuery(request));
            Assert.That(ex.Message, Is.StringContaining("DataSet1").And.StringContaining("DataSet2"));
        }
예제 #3
0
        public void ExtractQuery_ExistingReportAndDataSet_CorrectQueryReturned()
        {
            var request = new NBi.Core.Report.FileRequest(
                    ReportFileDirectory
                    , "Currency_List"
                    , "Currency"
                );

            var parser = new FileParser();
            var query = parser.ExtractQuery(request);

            Assert.That(query,
                Is.StringContaining("SELECT").And
                .StringContaining("[CurrencyAlternateKey]").And
                .StringContaining("[DimCurrency]"));
        }
예제 #4
0
        public void ExtractQuery_ExistingReportAndSharedDataSet_CorrectQueryReturned()
        {
            var request = new NBi.Core.Report.FileRequest(
                    ReportFileDirectory
                    , "Employee_Sales_Summary"
                    , "SalesEmployees2008R2"
                );

            var parser = new FileParser();
            var query = parser.ExtractQuery(request);

            Assert.That(query,
                Is.StringContaining("SELECT").And
                .StringContaining("[Sales].[SalesPerson]").And
                .StringContaining("[HumanResources].[Employee]"));
        }