예제 #1
0
            public void Should_Throw_On_Null_Pattern_Parameter()
            {
                //Given
                ICakeContext context    = _Context;
                string       pattern    = null;
                string       folderPath = ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a report"
                };
                SsrsConnectionSettings settings = _Settings;

                //When
                var record = Record.Exception(() => SsrsAliases.SsrsUploadReport(context, pattern, folderPath, properties, settings));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(pattern));
            }
예제 #2
0
            public void Should_Throw_On_Null_FolderPath_Parameter()
            {
                //Given
                ICakeContext context = _Context;
                Action <SsrsConnectionSettings> settingsConfigurator = s => { };
                FilePath filePath   = "./App_Data/Reports/Employee_Sales_Summary.rdl";
                string   folderPath = null;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a report"
                };

                //When
                var record = Record.Exception(() => SsrsAliases.SsrsUploadReport(context, filePath, folderPath, properties, settingsConfigurator));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(folderPath));
            }
예제 #3
0
            public void Should_Upload_Single_Report()
            {
                //Given
                ICakeContext context    = _Context;
                FilePath     pattern    = System.IO.Path.Combine(_Context.ReportsDirectory, "Employee_Sales_Summary.rdl");
                string       folderPath = "/" + ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a report"
                };
                SsrsConnectionSettings settings = _Settings;

                //When
                var record = SsrsAliases.SsrsUploadReport(context, pattern, folderPath, properties, settings);

                //Then
                Assert.NotNull(record);
                Assert.Equal("Employee_Sales_Summary", record.Name, ignoreCase: true, ignoreLineEndingDifferences: true, ignoreWhiteSpaceDifferences: true);
            }
예제 #4
0
            public void Should_Return_On_Empty_Collection_On_Not_Matching_Any_Files_For_Pattern()
            {
                //Given
                ICakeContext context    = _Context;
                string       pattern    = "App_Data/Foobar/*.rdl";
                string       folderPath = ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a report"
                };
                SsrsConnectionSettings settings = _Settings;

                //When
                var records = SsrsAliases.SsrsUploadReport(context, pattern, folderPath, properties, settings);

                //Then
                Assert.NotNull(records);
                Assert.Empty(records);
            }