From f0c8d29f01734f4f527ea8817019dd40a8f09ba7 Mon Sep 17 00:00:00 2001 From: Alexander Nachtmann Date: Thu, 16 Jan 2025 07:20:59 +0100 Subject: [PATCH] Update MinioTests.cs --- Tests/MinioTests.cs | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Tests/MinioTests.cs b/Tests/MinioTests.cs index d72e710..b422e30 100644 --- a/Tests/MinioTests.cs +++ b/Tests/MinioTests.cs @@ -1,4 +1,4 @@ -using Contract.Logger; +using Contract.Logger; using FluentAssertions; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; @@ -15,17 +15,17 @@ public class MinioTests public async Task Setup() { var configBuilder = new ConfigurationBuilder() - .AddJsonFile("service-appsettings.json") - .AddEnvironmentVariables(); + .AddJsonFile("service-appsettings.json") + .AddEnvironmentVariables(); _configuration = configBuilder.Build(); _minioClient = new MinioClient() - .WithEndpoint(_configuration["MinIO:Endpoint"] ?? "localhost:9000") - .WithCredentials( - _configuration["MinIO:AccessKey"], - _configuration["MinIO:SecretKey"]) - .Build(); + .WithEndpoint(_configuration["MinIO:Endpoint"] ?? "localhost:9000") + .WithCredentials( + _configuration["MinIO:AccessKey"], + _configuration["MinIO:SecretKey"]) + .Build(); var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); _logger = new OperationLogger( @@ -66,11 +66,11 @@ public async Task UploadFile_ToMinio_Succeeds() // Arrange await using var fileStream = File.OpenRead(_testFilePath); var putObjectArgs = new PutObjectArgs() - .WithBucket(TestBucket) - .WithObject(TestFileName) - .WithStreamData(fileStream) - .WithObjectSize(fileStream.Length) - .WithContentType("application/pdf"); + .WithBucket(TestBucket) + .WithObject(TestFileName) + .WithStreamData(fileStream) + .WithObjectSize(fileStream.Length) + .WithContentType("application/pdf"); // Act await _minioClient.PutObjectAsync(putObjectArgs); @@ -98,13 +98,13 @@ public async Task GetFile_FromMinio_Succeeds() using var memoryStream = new MemoryStream(); var getObjectArgs = new GetObjectArgs() - .WithBucket(TestBucket) - .WithObject(TestFileName) - .WithCallbackStream(stream => - { - stream.CopyTo(memoryStream); - memoryStream.Position = 0; - }); + .WithBucket(TestBucket) + .WithObject(TestFileName) + .WithCallbackStream(stream => + { + stream.CopyTo(memoryStream); + memoryStream.Position = 0; + }); // Act await _minioClient.GetObjectAsync(getObjectArgs); @@ -127,8 +127,8 @@ public async Task DeleteFile_FromMinio_Succeeds() { // Arrange var removeObjectArgs = new RemoveObjectArgs() - .WithBucket(TestBucket) - .WithObject(TestFileName); + .WithBucket(TestBucket) + .WithObject(TestFileName); // Act await _minioClient.RemoveObjectAsync(removeObjectArgs);