Skip to content

CBOR requests protocol test and extensions tests #3890

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

Conversation

muhammad-othman
Copy link
Member

Description

  • Add CBOR Protocol Tests.
  • Update Protocol test models to v1.0.5931.0 and Smithy v1.58.0.
  • Add Tests for CBOR extension project.
  • Added placeholders for CBOR unmarshaller generators to be able to execute the dry run.

Motivation and Context

  • DOTNET-8157
  • DOTNET-8158

Testing

DRY_RUN-e6b2cf96-b7e0-438b-b2a4-9df1826a5628

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@peterrsongg peterrsongg self-requested a review June 20, 2025 19:08
Copy link
Contributor

@peterrsongg peterrsongg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, made sure the protocol tests run succesfully and am aware that the unmarshaller.tt files are just placeholders for now

@muhammad-othman muhammad-othman force-pushed the muhamoth/DOTNET-8157-cbor-requests-protocol-tests branch from 0007326 to 3f79895 Compare June 24, 2025 00:01
@boblodgett boblodgett self-requested a review June 24, 2025 17:28
[InlineData("2025-06-19T20:15:28.468Z", 1750364128.468, CborReaderState.DoublePrecisionFloat, 10)]
public void WriteDateTime_EncodesCorrectly(string isoDate, double expectedUnixEpoch, CborReaderState expectedState, int expectedTotalBytes)
{
var dt = DateTime.Parse(isoDate).ToUniversalTime();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isoDate is already in UTC. You can parse it as such using:

DateTime.Parse(isoDate, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal)

@@ -137,7 +150,7 @@ private void arrangeResponseTestBlock(HttpResponseTestCase httpResponseTestCase)
for (var header : httpResponseTestCase.getHeaders().keySet()) {
writer.write("webResponseData.Headers[$S] = $S;", header, httpResponseTestCase.getHeaders().get(header));
}
writer.write("byte[] bytes = Encoding.ASCII.GetBytes($S);", httpResponseTestCase.getBody());
writer.write("byte[] bytes = Encoding.ASCII.GetBytes($S);", httpResponseTestCase.getBody());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect whitespace change / indentation.

@muhammad-othman muhammad-othman force-pushed the muhamoth/DOTNET-8157-cbor-requests-protocol-tests branch from 3f79895 to ecde7e6 Compare June 27, 2025 19:32
@muhammad-othman muhammad-othman merged commit 98e2a5a into cbor-protocol Jun 27, 2025
1 check passed
@muhammad-othman muhammad-othman deleted the muhamoth/DOTNET-8157-cbor-requests-protocol-tests branch June 27, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants