diff options
Diffstat (limited to 'Test/Program.cs')
-rw-r--r-- | Test/Program.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Test/Program.cs b/Test/Program.cs new file mode 100644 index 0000000..2739294 --- /dev/null +++ b/Test/Program.cs @@ -0,0 +1,21 @@ +using System.Text.Json; +using LibMatrix; +using LibMatrix.Homeservers.ImplementationDetails.Synapse.Models.Responses; + +// var src1 = new SynapseCollectionResult<EventIdResponse>(); +// var src2 = new SynapseCollectionResult<EventIdResponse>(chunkKey: "meow", nextTokenKey: "woof", prevTokenKey: "bark", totalKey: "purr"); +// +// for (int i = 0; i < 10000000; i++) { +// src1.Chunk.Add(new EventIdResponse { EventId = Guid.NewGuid().ToString() }); +// src2.Chunk.Add(new EventIdResponse { EventId = Guid.NewGuid().ToString() }); +// } +// +// File.WriteAllText("src1.json", JsonSerializer.Serialize(src1, new JsonSerializerOptions(){WriteIndented = true})); +// File.WriteAllText("src2.json", JsonSerializer.Serialize(src2, new JsonSerializerOptions(){WriteIndented = true})); + +using var stream1 = File.OpenRead("src1.json"); +var dst1 = new SynapseCollectionResult<EventIdResponse>().FromJson(stream1, (item) => { + ArgumentNullException.ThrowIfNull(item.EventId); +}); + +var a = new StateEventResponse(); \ No newline at end of file |