[#25] Client: Implement Patch and Range methods
All checks were successful
DCO / DCO (pull_request) Successful in 47s
All checks were successful
DCO / DCO (pull_request) Successful in 47s
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
bff8d67867
commit
003b7fdfdd
51 changed files with 1338 additions and 137 deletions
36
src/FrostFS.SDK.Tests/Mocks/PatchStreamWriter.cs
Normal file
36
src/FrostFS.SDK.Tests/Mocks/PatchStreamWriter.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue