public void ResolveType_Throws_When_BlockType_Property_DoesNot_Exist( string json) { var jsonDocument = JsonDocument.Parse(json); var typeProvider = new BlockJsonTypeResolver(jsonDocument.RootElement); Assert.Throws <JsonException>(() => typeProvider.ResolveType()); }
public void ResolveType_Returns_Expected_Type( string elementType, Type expectedType) { var jsonDocument = JsonDocument.Parse( $"{{\"{Block.BlockTypeJsonName}\":\"{elementType}\"}}"); var typeProvider = new BlockJsonTypeResolver(jsonDocument.RootElement); var actualType = typeProvider.ResolveType(); Assert.Equal( expectedType, actualType); }