using System.Collections.ObjectModel; using FrostFS.SDK.ProtosV2.Interfaces; using Grpc.Core; namespace FrostFS.SDK.Tests; public class PatchStreamWriter : IClientStreamWriter { private WriteOptions? _options; public Collection Messages { get; } = []; public bool CompletedTask { get; private set; } public WriteOptions? WriteOptions { get => _options; set => _options = value; } public Task CompleteAsync() { CompletedTask = true; return Task.CompletedTask; } public Task WriteAsync(IRequest message) { Object.PatchRequest pr = new((Object.PatchRequest)message); Messages.Add(pr); return Task.CompletedTask; } }