Пример #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 DataSet"
                };
                SsrsConnectionSettings settings = _Settings;

                //When
                var record = Record.Exception(() => SsrsAliases.SsrsUploadDataSet(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/SalesEmployees.rsd";
                string   folderPath = null;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a report"
                };

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

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(folderPath));
            }
Пример #3
0
            public void Should_Throw_On_Null_Settings_Context()
            {
                //Given
                ICakeContext           context  = null;
                SsrsConnectionSettings settings = _Settings;
                FilePath filePath   = "./App_Data/Reports/SalesEmployees.rsd";
                string   folderPath = ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a DataSet"
                };

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

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(context));
            }
Пример #4
0
            public void Should_Upload_Multiple_DataSets()
            {
                //Given
                ICakeContext context    = _Context;
                string       pattern    = "./App_Data/**/Emp*.rsd";
                string       folderPath = "/" + ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a DataSet"
                };
                SsrsConnectionSettings settings = _Settings;

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

                //Then
                Assert.NotEmpty(records);
                Assert.Equal(3, records.Count());
            }
Пример #5
0
            public void Should_Upload_Single_DataSet()
            {
                //Given
                ICakeContext context    = _Context;
                FilePath     pattern    = System.IO.Path.Combine(_Context.DataSetsDirectory, "SalesEmployees.rsd");
                string       folderPath = "/" + ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a DataSet"
                };
                SsrsConnectionSettings settings = _Settings;

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

                //Then
                Assert.NotNull(record);
                Assert.Equal("SalesEmployees", record.Name, ignoreCase: true, ignoreLineEndingDifferences: true, ignoreWhiteSpaceDifferences: true);
            }
Пример #6
0
            public void Should_Return_On_Empty_Collection_On_Not_Matching_Any_Files_For_Pattern()
            {
                //Given
                ICakeContext context    = _Context;
                string       pattern    = "App_Data/Foobar/*.rsd";
                string       folderPath = ParentFolderPath;
                IDictionary <string, string> properties = new Dictionary <string, string>()
                {
                    ["Description"] = "Great Description for a DataSet"
                };
                SsrsConnectionSettings settings = _Settings;

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

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