Repository navigation
[Fix] AttributeValueXHTML public constructors no longer leave ExternalObjects or the logger null; fixes #98 - #101
Merged
Merged
Conversation
…lObjects or the logger null; fixes #98 - Initialise ExternalObjects where it is declared, so every constructor gets an empty list; QueryExternalObjects and QueryBase64PayloadsAsync of ReqIFSharp.Extensions threw for values made with the ILoggerFactory constructor. - Set a NullLogger in the parameterless constructor; reading into such a value threw an ArgumentNullException. - Correct the doc comment of the ILoggerFactory constructor. - Add tests for the constructors, reading and cancelling with the parameterless constructor, and the Extensions queries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Prerequisites
Description
Fixes #98.
The public constructors of
AttributeValueXHTMLeach left a fieldnull:AttributeValueXHTML(ILoggerFactory)did not createExternalObjects.QueryExternalObjects(ReqIFSharp.Extensions) then threw anArgumentNullExceptionandQueryBase64PayloadsAsyncaNullReferenceExceptionfor a spec element holding such a value, andReqIFContentExtensions.QueryExternalObjectsfailed for the whole content.AttributeValueXHTML()did not set the logger, so reading into such a value threw anArgumentNullException.Changes (
AttributeValueXHTML.cs)ExternalObjectsis initialised where it is declared, so every constructor gets an empty list; the assignments in the two internal constructors are removed.NullLogger<AttributeValueXHTML>.Instance, as the other attribute value classes do.ILoggerFactoryconstructor namedAttributeValueString; it now namesAttributeValueXHTML.Tests
AttributeValueXHTMLTestFixture: every public constructor creates an emptyExternalObjects; a value made withnew AttributeValueXHTML()can be read (sync and async) and itsReadXmlAsynccan be cancelled.SpecElementWithAttributesExtensionTestFixture:QueryExternalObjectsandQueryBase64PayloadsAsyncreturn empty results for values made with each public constructor.dotnet build -c Release: 0 warnings;dotnet test: 564 passed.🤖 Generated with Claude Code