[#24] Client: Implement pool part1
first iteration - base classes and methods Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
d1271df207
commit
c9a75ea025
72 changed files with 2786 additions and 468 deletions
48
src/FrostFS.SDK.Tests/SessionTestsBase.cs
Normal file
48
src/FrostFS.SDK.Tests/SessionTestsBase.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Security.Cryptography;
|
||||
|
||||
using FrostFS.SDK.ClientV2.Interfaces;
|
||||
using FrostFS.SDK.Cryptography;
|
||||
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace FrostFS.SDK.Tests;
|
||||
|
||||
public abstract class SessionTestsBase
|
||||
{
|
||||
internal readonly string key = "KwHDAJ66o8FoLBjVbjP2sWBmgBMGjt7Vv4boA7xQrBoAYBE397Aq";
|
||||
|
||||
protected IOptions<SingleOwnerClientSettings> Settings { get; set; }
|
||||
|
||||
protected ECDsa ECDsaKey { get; set; }
|
||||
protected FrostFsOwner OwnerId { get; set; }
|
||||
protected SessionMocker Mocker { get; set; }
|
||||
|
||||
protected SessionTestsBase()
|
||||
{
|
||||
Settings = Options.Create(new SingleOwnerClientSettings
|
||||
{
|
||||
Key = key,
|
||||
Host = "http://localhost:8080"
|
||||
});
|
||||
|
||||
ECDsaKey = key.LoadWif();
|
||||
OwnerId = FrostFsOwner.FromKey(ECDsaKey);
|
||||
|
||||
Mocker = new SessionMocker(this.key)
|
||||
{
|
||||
PlacementPolicy = new FrostFsPlacementPolicy(true, new FrostFsReplica(1)),
|
||||
Version = new FrostFsVersion(2, 13)
|
||||
};
|
||||
}
|
||||
|
||||
protected IFrostFSClient GetClient()
|
||||
{
|
||||
return ClientV2.FrostFSClient.GetTestInstance(
|
||||
Settings,
|
||||
null,
|
||||
new NetworkMocker(this.key).GetMock().Object,
|
||||
Mocker.GetMock().Object,
|
||||
new ContainerMocker(this.key).GetMock().Object,
|
||||
new ObjectMocker(this.key).GetMock().Object);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue