-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathClientShould.cs
More file actions
38 lines (30 loc) · 857 Bytes
/
ClientShould.cs
File metadata and controls
38 lines (30 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace Storage.Tests;
public sealed class ClientShould(StorageFixture fixture) : IClassFixture<StorageFixture>
{
private readonly CancellationToken _ct = CancellationToken.None;
private readonly S3BucketClient _client = fixture.S3Client;
[Fact]
public void DeserializeSettingsJson()
{
var expected = fixture.Settings;
var json = JsonSerializer.Serialize(expected);
var actual = JsonSerializer.Deserialize<S3BucketSettings>(json);
actual.Should().BeEquivalentTo(expected);
}
[Fact]
public void HasValidInfo()
{
_client
.Bucket
.Should().Be(fixture.Settings.Bucket);
}
[Fact]
public Task ThrowIfDisposed()
{
var client = TestHelper.CloneClient(fixture, null, new HttpClient());
client.Dispose();
return client
.Invoking(c => c.CreateBucket(_ct))
.Should().ThrowExactlyAsync<ObjectDisposedException>();
}
}