public void Should_get_null_if_number_property_not_found() { var sut = new AssetMetadata(); var found = sut.TryGetNumber("other", out var result); Assert.False(found); Assert.Equal(0, result); }
public void Should_get_null_if_property_is_not_number() { var sut = new AssetMetadata { ["number"] = JsonValue.Create(true) }; var found = sut.TryGetNumber("number", out var result); Assert.False(found); Assert.Equal(0, result); }
public void Should_get_number_if_found() { var value = 12.5; var sut = new AssetMetadata { ["number"] = JsonValue.Create(value) }; var found = sut.TryGetNumber("number", out var result); Assert.True(found); Assert.Equal(value, result); }