Skip to content

Commit eaea9e5

Browse files
committed
fix up test
1 parent 088a782 commit eaea9e5

File tree

2 files changed

+32
-19
lines changed

2 files changed

+32
-19
lines changed

Documentation/CodeTutorials/Packages.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
| WeCantSpell.Hunspell | [GitHub](https://github.com/aarondandy/WeCantSpell.Hunspell/) | [GPL-2 and others](https://github.com/aarondandy/WeCantSpell.Hunspell/blob/main/license.txt) | |
1717
| [DockPanelSuite.ThemeVS2015](http://dockpanelsuite.com/) | [GitHub](https://github.com/dockpanelsuite/dockpanelsuite) | [MIT](https://opensource.org/licenses/MIT) | Provides Window layout and docking for RDMP. | There are no powershell initialization files in the package which can be run by the NuGet installer.|
1818
| [FAM FAM FAM Icons](https://github.com/markjames/famfamfam-silk-icons) | N\A | [CC 2.5](https://creativecommons.org/licenses/by/2.5/) | Icons for user interfaces |
19-
| CommandLineParser | [GitHub](https://github.com/commandlineparser/commandline) | [MIT](https://opensource.org/licenses/MIT) | Allows command line arguments for main client application and CLI executables |
19+
| CommandLineParser | [GitHub](https://github.cosystem.m/commandlineparser/commandline) | [MIT](https://opensource.org/licenses/MIT) | Allows command line arguments for main client application and CLI executables |
2020
| NPOI | [GitHub](https://github.com/tonyqus/npoi) | Apache 2.0 | Enables reading/writing Microsoft Excel files |
2121
| ExcelNumberFormat | [GitHub](https://github.com/andersnm/ExcelNumberFormat) |[MIT](https://opensource.org/licenses/MIT) | Handles translating number formats from Excel formats into usable values | |
2222
| LibArchive.Net | [GitHub](https://github.com/jas88/libarchive.net) | [BSD](https://opensource.org/license/bsd-2-clause/) | Access archive formats without the LZMA bugs of SharpCompress | |
@@ -29,7 +29,6 @@
2929
| YamlDotNet | [GitHub](https://github.com/aaubry/YamlDotNet) | [MIT](https://opensource.org/licenses/MIT) |Loading configuration files|
3030
| SixLabors.ImageSharp | [GitHub](https://github.com/SixLabors/ImageSharp) | [Apache 2.0](https://github.com/SixLabors/ImageSharp/blob/main/LICENSE) | Platform-independent replacement for legacy Windows-only System.Drawing.Common | |
3131
| SixLabors.ImageSharp.Drawing | [GitHub](https://github.com/SixLabors/ImageSharp.Drawing) | [Apache 2.0](https://github.com/SixLabors/ImageSharp/blob/main/LICENSE) | Font handling for ImageSharp | |
32-
| System.Private.Uri | Part of .Net, referenced to override vulnerable transitive dependency | .Net SDK | |
3332
| [AutoComplete Console](https://www.codeproject.com/Articles/1182358/Using-Autocomplete-in-Windows-Console-Applications) by Jasper Lammers | Embedded | [CPOL](https://www.codeproject.com/info/cpol10.aspx) | Provides interactive autocomplete in console input | |
3433
| Spectre.Console | [GitHub](https://github.com/spectreconsole/spectre.console) | [MIT](https://opensource.org/licenses/MIT) | Allows richer command line interactions| |
3534
| HIC.System.Windows.Forms.DataVisualization | [GitHub](https://github.com/HicServices/winforms-datavisualization) |[MIT](https://opensource.org/licenses/MIT) | Dotnet core support for DQE charts | |

Rdmp.Core.Tests/DataExport/DataRelease/S3BucketReleaseDestinationTests.cs

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
using NUnit.Framework;
2-
using Minio;
3-
using Rdmp.Core.ReusableLibraryCode.AWS;
4-
using Tests.Common.Scenarios;
5-
using Rdmp.Core.DataFlowPipeline;
6-
using Rdmp.Core.ReusableLibraryCode.Progress;
7-
using System;
8-
using Rdmp.Core.Curation.Data.Pipelines;
9-
using Rdmp.Core.DataExport.DataRelease;
1+
using Minio;
2+
using Minio.ApiEndpoints;
3+
using Minio.DataModel.Args;
4+
using NUnit.Framework;
5+
using Rdmp.Core.CommandExecution;
106
using Rdmp.Core.CommandLine.Options;
117
using Rdmp.Core.CommandLine.Runners;
12-
using Rdmp.Core.CommandExecution;
8+
using Rdmp.Core.Curation.Data.DataLoad;
9+
using Rdmp.Core.Curation.Data.Pipelines;
10+
using Rdmp.Core.DataExport.DataRelease;
11+
using Rdmp.Core.DataFlowPipeline;
12+
using Rdmp.Core.ReusableLibraryCode.AWS;
1313
using Rdmp.Core.ReusableLibraryCode.Checks;
14-
using System.Linq;
15-
using Minio.DataModel.Args;
14+
using Rdmp.Core.ReusableLibraryCode.Progress;
15+
using System;
1616
using System.Collections.Generic;
17-
using Rdmp.Core.Curation.Data.DataLoad;
17+
using System.Linq;
18+
using System.Reactive.Linq;
19+
using System.Threading;
20+
using System.Threading.Tasks;
21+
using Tests.Common.Scenarios;
1822
namespace Rdmp.Core.Tests.DataExport.DataRelease;
1923

2024
public sealed class S3BucketReleaseDestinationTests : TestsRequiringAnExtractionConfiguration
@@ -63,10 +67,20 @@ private static void DeleteBucket(string name)
6367

6468
private static List<Minio.DataModel.Item> GetObjects(string bucketName)
6569
{
66-
throw new Exception("This needs to be fixed by minio");
67-
//var loArgs = new ListObjectsArgs().WithBucket(bucketName);
68-
//var x = _minioClient.ListObjectsEnumAsync(loArgs).ToListAsync<Item>();
69-
//return x.IsCompleted ? x.Result : x.AsTask().Result;
70+
var loArgs = new ListObjectsArgs().WithBucket(bucketName);
71+
var x = _minioClient.ListObjectsEnumAsync(loArgs);
72+
var results = ToListAsync(x).Result;
73+
return results;
74+
}
75+
76+
public static async Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> items,
77+
CancellationToken cancellationToken = default)
78+
{
79+
var results = new List<T>();
80+
await foreach (var item in items.WithCancellation(cancellationToken)
81+
.ConfigureAwait(false))
82+
results.Add(item);
83+
return results;
7084
}
7185

7286
private static void SetArgs(IArgument[] args, Dictionary<string, object> values)

0 commit comments

Comments
 (0)