Skip to content

Commit

Permalink
chore: Rename test member
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Oct 18, 2023
1 parent e339e4a commit b745326
Showing 1 changed file with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,41 @@ public Task DisposeAsync()
return _fakeGcsServerContainer.DisposeAsync().AsTask();
}

public sealed class BlobService : FakeGcsServerContainerTest
[Fact]
[Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))]
public async Task DownloadObjectReturnsUploadObject()
{
[Fact]
[Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))]
public async Task EstablishesConnection()
{
// Given
const string helloWorld = "Hello, World!";
// Given
const string helloWorld = "Hello, World!";

using var writeStream = new MemoryStream(Encoding.Default.GetBytes(helloWorld));
using var writeStream = new MemoryStream(Encoding.Default.GetBytes(helloWorld));

using var readStream = new MemoryStream();
using var readStream = new MemoryStream();

var project = Guid.NewGuid().ToString("D");
var project = Guid.NewGuid().ToString("D");

var bucket = Guid.NewGuid().ToString("D");
var bucket = Guid.NewGuid().ToString("D");

var fileName = Path.GetRandomFileName();
var fileName = Path.GetRandomFileName();

var storageClientBuilder = new StorageClientBuilder();
storageClientBuilder.UnauthenticatedAccess = true;
storageClientBuilder.BaseUri = _fakeGcsServerContainer.GetConnectionString();
var storageClientBuilder = new StorageClientBuilder();
storageClientBuilder.UnauthenticatedAccess = true;
storageClientBuilder.BaseUri = _fakeGcsServerContainer.GetConnectionString();

// When
var client = await storageClientBuilder.BuildAsync()
.ConfigureAwait(false);
// When
var client = await storageClientBuilder.BuildAsync()
.ConfigureAwait(false);

_ = await client.CreateBucketAsync(project, bucket)
.ConfigureAwait(false);
_ = await client.CreateBucketAsync(project, bucket)
.ConfigureAwait(false);

_ = await client.UploadObjectAsync(bucket, fileName, "text/plain", writeStream)
.ConfigureAwait(false);
_ = await client.UploadObjectAsync(bucket, fileName, "text/plain", writeStream)
.ConfigureAwait(false);

_ = await client.DownloadObjectAsync(bucket, fileName, readStream)
.ConfigureAwait(false);
_ = await client.DownloadObjectAsync(bucket, fileName, readStream)
.ConfigureAwait(false);

// Then
Assert.Equal(helloWorld, Encoding.Default.GetString(readStream.ToArray()));
}
// Then
Assert.Equal(helloWorld, Encoding.Default.GetString(readStream.ToArray()));
}
}

0 comments on commit b745326

Please sign in to comment.