36 lines
747 B
C#
36 lines
747 B
C#
using System.Collections.ObjectModel;
|
|
|
|
using FrostFS.SDK.ProtosV2.Interfaces;
|
|
|
|
using Grpc.Core;
|
|
|
|
namespace FrostFS.SDK.Tests;
|
|
|
|
public class PatchStreamWriter : IClientStreamWriter<IRequest>
|
|
{
|
|
private WriteOptions? _options;
|
|
|
|
public Collection<IRequest> 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;
|
|
}
|
|
}
|
|
|