using FrostFS.SDK.ClientV2; using FrostFS.SDK.ClientV2.Interfaces; using FrostFS.SDK.Cryptography; using Microsoft.Extensions.Options; namespace FrostFS.SDK.Tests; public abstract class ObjectTestsBase { protected static readonly string key = "KwHDAJ66o8FoLBjVbjP2sWBmgBMGjt7Vv4boA7xQrBoAYBE397Aq"; protected IOptions Settings { get; set; } protected FrostFsContainerId ContainerId { get; set; } protected NetworkMocker NetworkMocker { get; set; } = new NetworkMocker(key); protected SessionMocker SessionMocker { get; set; } = new SessionMocker(key); protected ContainerMocker ContainerMocker { get; set; } = new ContainerMocker(key); protected ObjectMocker Mocker { get; set; } protected ObjectTestsBase() { var ecdsaKey = key.LoadWif(); Settings = Options.Create(new SingleOwnerClientSettings { Key = key, Host = "http://localhost:8080" }); Mocker = new ObjectMocker(key) { PlacementPolicy = new FrostFsPlacementPolicy(true, new FrostFsReplica(1)), Version = new FrostFsVersion(2, 13), ContainerGuid = Guid.NewGuid() }; ContainerId = new FrostFsContainerId(Base58.Encode(Mocker.ContainerGuid.ToBytes())); Mocker.ObjectHeader = new( ContainerId, FrostFsObjectType.Regular, [new FrostFsAttributePair("k", "v")], null, FrostFsOwner.FromKey(ecdsaKey), new FrostFsVersion(2, 13)); } protected IFrostFSClient GetClient() { return FrostFSClient.GetTestInstance( Settings, null, NetworkMocker.GetMock().Object, SessionMocker.GetMock().Object, ContainerMocker.GetMock().Object, Mocker.GetMock().Object); } }