Rename project, namespaces and class names Signed-off-by: Pavel Gross <p.gross@yadro.com>
48 lines
1.5 KiB
C#
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);
|
|
}
|
|
}
|