-
Notifications
You must be signed in to change notification settings - Fork 0
Fixes from reviews. #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fixes from reviews. #145
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9fea5cb
Fixes from reviews.
04b9913
feat: add SerializerHelpers as a complete reviewable unit
17d71bb
Merge branch 'review-fixes' of https://github.com/demaconsulting/Test…
d98ad33
fix: address formal review findings across four review-sets
3e467e7
Update docs/design/test-results-library/io/serializer-helpers.md
Malcolmnixon 781ab5d
fix: remove requirements file-link from design doc
ccccae9
Merge branch 'review-fixes' of https://github.com/demaconsulting/Test…
e889ec7
Update test/DemaConsulting.TestResults.Tests/IO/SerializerTests.cs
Malcolmnixon 8973147
Update test/DemaConsulting.TestResults.Tests/IO/TrxSerializerTests.cs
Malcolmnixon c36928d
Fix AAA sectioning in TrxSerializerTests: move Assert.IsNotNull to As…
Copilot 0b5b8b7
Align encoding casing: use lowercase utf-8 consistently in comments a…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
docs/reqstream/test-results-library/io/serializer-helpers.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| # Software Unit Requirements for the SerializerHelpers Unit | ||
| # | ||
| # DERIVATION NOTE: These requirements are a top-down decomposition of | ||
| # TestResults-IO-Serialize (io.yaml). The IO subsystem's obligation to produce | ||
| # correctly-encoded XML serialized output decomposes into three sibling unit | ||
| # responsibilities: TrxSerializer, JUnitSerializer, and SerializerHelpers. | ||
| # SerializerHelpers satisfies the shared encoding constraint that both XML | ||
| # serializer units depend on. | ||
| # | ||
| # These requirements were NOT derived from or driven by the existing | ||
| # implementation. The need for a correct UTF-8 encoding declaration is an | ||
| # interoperability constraint placed on the IO subsystem by downstream XML | ||
| # consumers; SerializerHelpers is the unit that satisfies that constraint | ||
| # on behalf of both serializer units. | ||
|
|
||
| sections: | ||
| - title: SerializerHelpers Unit Requirements | ||
| requirements: | ||
| - id: TestResults-SerializerHelpers-Utf8Encoding | ||
| title: The SerializerHelpers unit shall provide a string writer that reports UTF-8 as its character encoding. | ||
| justification: | | ||
| XML serializers read the encoding reported by their underlying string writer to | ||
| determine which encoding declaration to emit in the XML prolog. The IO subsystem | ||
| must produce XML output that declares encoding="UTF-8" so that downstream tools | ||
| correctly interpret the byte stream. The default StringWriter reports UTF-16, which | ||
| would produce an incorrect declaration. This unit satisfies the encoding constraint | ||
| shared by both TrxSerializer and JUnitSerializer by providing a writer that correctly | ||
| reports UTF-8, decomposing the TestResults-IO-Serialize obligation. | ||
|
Malcolmnixon marked this conversation as resolved.
Outdated
|
||
| tests: | ||
| - Utf8StringWriter_Encoding_ReturnsUtf8 | ||
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
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
48 changes: 48 additions & 0 deletions
48
test/DemaConsulting.TestResults.Tests/IO/SerializerHelpersTests.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright(c) 2025 DEMA Consulting | ||
| // | ||
| // Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| // of this software and associated documentation files (the "Software"), to deal | ||
| // in the Software without restriction, including without limitation the rights | ||
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| // copies of the Software, and to permit persons to whom the Software is | ||
| // furnished to do so, subject to the following conditions: | ||
| // | ||
| // The above copyright notice and this permission notice shall be included in all | ||
| // copies or substantial portions of the Software. | ||
| // | ||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| // SOFTWARE. | ||
|
|
||
| using System.Text; | ||
| using DemaConsulting.TestResults.IO; | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace DemaConsulting.TestResults.Tests.IO; | ||
|
|
||
| /// <summary> | ||
| /// Tests for SerializerHelpers unit | ||
| /// </summary> | ||
| [TestClass] | ||
| public sealed class SerializerHelpersTests | ||
| { | ||
| /// <summary> | ||
| /// Test that Utf8StringWriter reports UTF-8 as its encoding | ||
| /// </summary> | ||
| [TestMethod] | ||
| public void Utf8StringWriter_Encoding_ReturnsUtf8() | ||
| { | ||
| // Arrange: create a Utf8StringWriter | ||
| using var writer = new Utf8StringWriter(); | ||
|
|
||
| // Act: read the reported encoding | ||
| var encoding = writer.Encoding; | ||
|
|
||
| // Assert: encoding is UTF-8 | ||
| Assert.AreEqual(Encoding.UTF8, encoding); | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.