public void Should_Throw_On_Null_Or_Empty_Request_Parameter() { //Given ICakeContext context = _Context; SsrsConnectionSettings settings = _Settings; FindItemRequest request = null; //When var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settings)); //Then CakeAssert.IsArgumentNullException(record, nameof(request)); }
public void Should_Throw_On_Null_FolderName_Context() { //Given ICakeContext context = _Context; SsrsConnectionSettings settings = _Settings; string folderName = string.Empty; string parentFolder = null; //When var record = Record.Exception(() => SsrsAliases.SsrsCreateFolder(context, folderName, parentFolder, settings)); //Then CakeAssert.IsArgumentNullException(record, nameof(folderName)); }
public void Should_Create_New_Folder() { //Given ICakeContext context = _Context; SsrsConnectionSettings settings = _Settings; string folderName = ParentFolderPath; string parentFolder = null; //When var item = SsrsAliases.SsrsCreateFolder(context, folderName, parentFolder, settings); //Then Assert.NotNull(item); Assert.Equal(item.Name, folderName, ignoreCase: true, ignoreLineEndingDifferences: true, ignoreWhiteSpaceDifferences: true); }
public void Should_Throw_On_Null_Settings_Context() { //Given ICakeContext context = null; SsrsConnectionSettings settings = _Settings; FilePath filePath = "./App_Data/DataSources/AdventureWorks.rds"; string folderPath = ParentFolderPath; IDictionary <string, string> properties = new Dictionary <string, string>() { ["Description"] = "Great Description for a DataSource" }; //When var record = Record.Exception(() => SsrsAliases.SsrsUploadDataSource(context, filePath, folderPath, properties, settings)); //Then CakeAssert.IsArgumentNullException(record, nameof(context)); }
public void Should_Return_Catalog_Item(string folder, string itemName) { //Given ICakeContext context = _Context; SsrsConnectionSettings settings = _Settings; FindItemRequest request = new FindItemRequest { Folder = folder, ItemName = itemName, Recursive = true }; //When var item = SsrsAliases.SsrsFindItem(context, request, settings); //Then Assert.NotNull(item); }
public void Should_Throw_On_Null_SettingsConfigurator_Parameter() { //Given ICakeContext context = _Context; Action <SsrsConnectionSettings> settingsConfigurator = null; FindItemRequest request = new FindItemRequest { Folder = "/AdventureWorks", ItemName = null, Recursive = true }; //When var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settingsConfigurator)); //Then CakeAssert.IsArgumentNullException(record, nameof(settingsConfigurator)); }
public void Should_Throw_On_Null_Or_Empty_Folder_Parameter() { //Given ICakeContext context = _Context; SsrsConnectionSettings settings = _Settings; FindItemRequest request = new FindItemRequest { Folder = null, ItemName = "Item Name", Recursive = true }; //When var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settings)); //Then CakeAssert.IsArgumentNullException(record, nameof(request.Folder)); }
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)); }
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)); }
public void Should_Throw_On_Null_FilePath_Parameter() { //Given ICakeContext context = _Context; Action <SsrsConnectionSettings> settingsConfigurator = s => { }; FilePath filePath = null; string folderPath = ParentFolderPath; IDictionary <string, string> properties = new Dictionary <string, string>() { ["Description"] = "Great Description for a DataSource" }; //When var record = Record.Exception(() => SsrsAliases.SsrsUploadDataSet(context, filePath, folderPath, properties, settingsConfigurator)); //Then CakeAssert.IsArgumentNullException(record, nameof(filePath)); }
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); }
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); }
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()); }