405f3f4ee4
* renamespace * add to sln and move * manage package centrally * add sourcelink and use GlobalPackageReference * properly use globals * fix nuget push * fix readme * add namespace handling for new types * Removing used classes to stop viral spread of dependencies. Some JSON usage was STJ and not newtonsoft * fmt * initial test * serialization namespace test * fmt * put back old namespaces * fix tests * fixes while trying to do a roundtrip test * remove namespace fix
48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using Speckle.Core.Transports;
|
|
|
|
namespace Speckle.Core.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<string, int>? 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 void SaveObject(string id, ITransport sourceTransport) => throw new NotImplementedException();
|
|
|
|
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();
|
|
}
|