frostfs-sdk-csharp/src/FrostFS.SDK.Tests/Unit/ContainerTestsBase.cs
Pavel Gross 43e300c773 [#29] Client: Add PlacementVector unit tests
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2025-01-13 10:34:44 +03:00

40 lines
1.2 KiB
C#

using FrostFS.SDK.Client.Interfaces;
using Microsoft.Extensions.Options;
namespace FrostFS.SDK.Tests.Unit;
public abstract class ContainerTestsBase
{
internal readonly string key = "KwHDAJ66o8FoLBjVbjP2sWBmgBMGjt7Vv4boA7xQrBoAYBE397Aq";
protected IOptions<ClientSettings> Settings { get; set; }
protected ContainerMocker Mocker { get; set; }
protected ContainerTestsBase()
{
Settings = Options.Create(new ClientSettings
{
Key = key,
Host = "http://localhost:8080"
});
Mocker = new ContainerMocker(key)
{
PlacementPolicy = new FrostFsPlacementPolicy(true, 1, [], [], new FrostFsReplica(1)),
Version = new FrostFsVersion(2, 13),
ContainerGuid = Guid.NewGuid()
};
}
protected IFrostFSClient GetClient()
{
return Client.FrostFSClient.GetTestInstance(
Settings,
(url) => Grpc.Net.Client.GrpcChannel.ForAddress(new Uri(url)),
new NetworkMocker(key).GetMock().Object,
new SessionMocker(key).GetMock().Object,
Mocker.GetMock().Object,
new ObjectMocker(key).GetMock().Object);
}
}