All checks were successful
DCO / DCO (pull_request) Successful in 46s
first iteration - base classes and methods Signed-off-by: Pavel Gross <p.gross@yadro.com>
35 lines
743 B
C#
35 lines
743 B
C#
using System.Collections.ObjectModel;
|
|
|
|
using FrostFS.SDK.ProtosV2.Interfaces;
|
|
|
|
using Grpc.Core;
|
|
|
|
namespace FrostFS.SDK.Tests;
|
|
|
|
public class ClientStreamWriter : 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.PutRequest pr = new((Object.PutRequest)message);
|
|
Messages.Add(pr);
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|