squash a bunch of commits

This commit is contained in:
2022-10-30 12:03:16 -05:00
parent 09b72c1858
commit 93027e8c57
222 changed files with 6157 additions and 3201 deletions

View File

@@ -0,0 +1,25 @@
using Newtonsoft.Json;
using Shogi.Contracts.Api;
using Shogi.Contracts.Types;
using System;
namespace UnitTests.ServiceModels;
public class ServiceModelsShouldSerialize
{
[Fact]
public void ServiceModelsSerializeAndDeserialize()
{
using var scope = new AssertionScope();
AssertTypeDeserializes(new CreateGuestTokenResponse("MyId", "MyDisplayName", Guid.NewGuid()));
AssertTypeDeserializes(new SessionMetadata { Name = "MyName", PlayerCount = 5 });
}
private static void AssertTypeDeserializes<T>(T t) where T : class
{
var serialized = JsonConvert.SerializeObject(t);
var deserialized = JsonConvert.DeserializeObject<T>(serialized);
deserialized.Should().BeEquivalentTo(t);
}
}