Files
speckle-sharp-sdk/tests/Speckle.Sdk.Serialization.Tests/TestTransport.cs
T
Adam Hathcock dc4da49078 Add Progress for transfers (#74)
* progress intermediate commit

* add progress for download

* remove unused code

* remove batch sent callbacks

* multi-threaded deserialize works

* Progress for download and deserialization

* Fix tests

* Have less indeterminate deserialization

* fix deserialization

* make download faster with buffered stream

* put local receive back

* remove unused callback

* fmt
2024-08-15 10:43:41 +02:00

46 lines
1.3 KiB
C#

using Speckle.Sdk.Transports;
namespace Speckle.Sdk.Serialization.Tests;
public class TestTransport : ITransport
{
public IDictionary<string, string> Objects { get; }
public TestTransport(IDictionary<string, string> objects)
{
Objects = objects;
}
public string TransportName
{
get => "Test";
set { }
}
public Dictionary<string, object> TransportContext { get; }
public TimeSpan Elapsed { get; }
public int SavedObjectCount { get; }
public CancellationToken CancellationToken { get; set; }
public Action<ProgressArgs>? OnProgressAction { get; set; }
public Action<string, Exception>? OnErrorAction { get; set; }
public void BeginWrite() => throw new NotImplementedException();
public void EndWrite() => throw new NotImplementedException();
public void SaveObject(string id, string serializedObject) => Objects[id] = serializedObject;
public Task WriteComplete() => throw new NotImplementedException();
public string? GetObject(string id) => Objects.TryGetValue(id, out string? o) ? o : null;
public Task<string> CopyObjectAndChildren(
string id,
ITransport targetTransport,
Action<int>? onTotalChildrenCountKnown = null
) => throw new NotImplementedException();
public Task<Dictionary<string, bool>> HasObjects(IReadOnlyList<string> objectIds) =>
throw new NotImplementedException();
}