Esempio n. 1
0
        public void ExtractQuery_NonExistingReport_CorrectExceptionReturned()
        {
            var request = new NBi.Core.Report.DatabaseRequest(
                    ConnectionStringReader.GetReportServerDatabase()
                    , "/AdventureWorks Sample Reports/"
                    , "Not Existing"
                    , "DataSet1"
                );

            var parser = new DatabaseParser();
            var ex = Assert.Throws<ArgumentException>(() => parser.ExtractQuery(request));
            Assert.That(ex.Message, Is.StringContaining("No report found"));
        }
Esempio n. 2
0
        public void ExtractQuery_NonExistingDataSetMoreThanOneExisting_CorrectExceptionReturned()
        {
            var request = new NBi.Core.Report.DatabaseRequest(
                ConnectionStringReader.GetReportServerDatabase()
                , "/AdventureWorks Sample Reports/"
                , "Currency Rates"
                , "Non Existing"
                );

            var parser = new DatabaseParser();
            var ex     = Assert.Throws <ArgumentException>(() => parser.ExtractQuery(request));

            Assert.That(ex.Message, Is.StringContaining("DataSet1").And.StringContaining("DataSet2"));
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
        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]"));
        }
Esempio n. 6
0
        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]"));
        }