Commit Graph

7 Commits

Author SHA1 Message Date
Jon Skeet ae75b32c28 chore: Fix whitespace in all files
These changes were generated automatically by running "Analyze and Code Cleanup".

Showing a diff ignoring whitespace shows the removal of the UTF-8 BOM from three files, but that's all.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2023-11-14 12:20:57 +00:00
Jon Skeet 4f13307d66 Update to .NET 6 SDK to build and netcoreapp3.1 for test
This requires a few nullable-reference-type overrides in tests where
we're absolutely confident they won't be null (and if we're wrong,
an NRE is fine to break the test).

Signed-off-by: Jon Skeet <jonskeet@google.com>
2022-01-12 07:09:02 +00:00
Jon Skeet e7ebdd7c1c Enable nullable reference types for unit test project
Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-07-10 07:03:43 +01:00
Jon Skeet 7d7da6fe62 Expose a CloudEventAttributeTypeOrdinal enum for CloudEventAttributeType
This is in the Core namespace as most users won't need it, and
instead of being exposed publicly on CloudEventAttributeType as a
property, it's available via a static method in a utility type in
the Core namespace. This effectively obscures it a little, while
still keeping it available to the formatter/protocol code it's
aimed at.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-03-31 06:39:27 +01:00
Jon Skeet 6656b5c123 Implement validation for CloudEventAttributeType.String
Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-03-04 22:48:19 +00:00
Jon Skeet 7d01a4a181 Fix URI parsing on Linux
This still leaves a hole where the user created a Uri instance
manually on Linux and it claims to be absolute, but it would
potentially be confusing to spot this in Validate as well...

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-02-11 07:57:38 +00:00
Jon Skeet 78dd8416b0 Add tests, primarily for CloudEvent, CloudEventAttribute and CloudEventAttributeType
Each of these classes has 100% coverage just by running their own tests.
There are still some areas of concern:

- .NET's URI parsing and formatting seems hard to predict, so we're not validating as much as I'd like
- There are some interesting questions about CloudEvent behavior which are tested in a "QuestionableBehavior" nested class in CloudEventTest

There's a fair amount of production code changing in here as well, primarily around validation.

Signed-off-by: Jon Skeet <jonskeet@google.com>
2021-02-11 07:57:38 +00:00