Schema.org objects turned into strongly typed C# POCO classes for use in .NET. All classes can be serialized into JSON/JSON-LD and XML, typically used to represent structured data in the head section of html page.
As per issue #675, when a whitespace string is passed to the Values(params object[] items) or Values(IEnumerable<object?> items) constructors of any of the Values<> classes, the HasValueX property will return true, where the corresponding ValueX will be empty.
Primary changes
Added tests to handle the known failure scenario.
Moved this.HasValueX evaluation and assignment to after this.ValueX assignment.
Ancillary changes
Updated .editorconfig to redefine new Roslyn analysers, ensuring that newer warnings don't fail the build.
Added a helper method to Schema.NET.Test, AssertEx.Empty<T>(OneOrMany<T> collection), which addresses the instances where the compiler was implicitly using string for Assert.Empty(OneOrMany<string>), instead of treating the input as an enumerable.
Overview
As per issue #675, when a whitespace string is passed to the
Values(params object[] items)
orValues(IEnumerable<object?> items)
constructors of any of theValues<>
classes, theHasValueX
property will returntrue
, where the correspondingValueX
will be empty.Primary changes
this.HasValueX
evaluation and assignment to afterthis.ValueX
assignment.Ancillary changes
.editorconfig
to redefine new Roslyn analysers, ensuring that newer warnings don't fail the build.Schema.NET.Test
,AssertEx.Empty<T>(OneOrMany<T> collection)
, which addresses the instances where the compiler was implicitly usingstring
forAssert.Empty(OneOrMany<string>)
, instead of treating the input as an enumerable.