frostfs-sdk-csharp/src/FrostFS.SDK.Tests/NetworkTestsBase.cs
Pavel Gross 766f61a5f7
All checks were successful
DCO / DCO (pull_request) Successful in 47s
lint-build / dotnet8.0 (pull_request) Successful in 47s
lint-build / dotnet8.0 (push) Successful in 1m0s
[#26] All: Remove V2 from naming
Rename project, namespaces and class names

Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-11-18 11:33:50 +03:00

48 lines
1.5 KiB
C#

using System.Diagnostics.CodeAnalysis;
using System.Security.Cryptography;
using FrostFS.SDK.Client.Interfaces;
using FrostFS.SDK.Cryptography;
using Microsoft.Extensions.Options;
namespace FrostFS.SDK.Tests;
[SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "Default Value is correct for tests")]
public abstract class NetworkTestsBase
{
internal readonly string key = "KwHDAJ66o8FoLBjVbjP2sWBmgBMGjt7Vv4boA7xQrBoAYBE397Aq";
protected IOptions<SingleOwnerClientSettings> Settings { get; set; }
protected FrostFsVersion Version { get; set; } = new FrostFsVersion(2, 13);
protected ECDsa ECDsaKey { get; set; }
protected FrostFsOwner OwnerId { get; set; }
protected NetworkMocker Mocker { get; set; }
protected NetworkTestsBase()
{
Settings = Options.Create(new SingleOwnerClientSettings
{
Key = key,
Host = "http://localhost:8080"
});
ECDsaKey = key.LoadWif();
OwnerId = FrostFsOwner.FromKey(ECDsaKey);
Mocker = new NetworkMocker(this.key);
}
protected IFrostFSClient GetClient()
{
return Client.FrostFSClient.GetTestInstance(
Settings,
null,
Mocker.GetMock().Object,
new SessionMocker(this.key).GetMock().Object,
new ContainerMocker(this.key).GetMock().Object,
new ObjectMocker(this.key).GetMock().Object);
}
}