[#25] Client: Implement Patch and Range methods
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
43
src/FrostFS.SDK.Tests/Mocks/AsyncStreamRangeReaderMock.cs
Normal file
43
src/FrostFS.SDK.Tests/Mocks/AsyncStreamRangeReaderMock.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System.Security.Cryptography;
|
||||
|
||||
using FrostFS.Object;
|
||||
using FrostFS.SDK.ClientV2;
|
||||
using FrostFS.SDK.ClientV2.Mappers.GRPC;
|
||||
using FrostFS.SDK.Cryptography;
|
||||
using FrostFS.Session;
|
||||
|
||||
using Google.Protobuf;
|
||||
|
||||
using Grpc.Core;
|
||||
|
||||
namespace FrostFS.SDK.Tests;
|
||||
|
||||
public class AsyncStreamRangeReaderMock(string key, byte[] response) : ServiceBase(key), IAsyncStreamReader<GetRangeResponse>
|
||||
{
|
||||
private readonly byte[] _response = response;
|
||||
|
||||
public GetRangeResponse Current
|
||||
{
|
||||
get
|
||||
{
|
||||
var response = new GetRangeResponse
|
||||
{
|
||||
Body = new GetRangeResponse.Types.Body
|
||||
{
|
||||
Chunk = ByteString.CopyFrom(_response)
|
||||
},
|
||||
MetaHeader = new ResponseMetaHeader()
|
||||
};
|
||||
|
||||
response.VerifyHeader = GetResponseVerificationHeader(response);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<bool> MoveNext(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue