Skip to content
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

Add BeJsonSerializable extensions for objects #2557

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Jan 14, 2024

Draft for #2555

Add the following methods for ObjectAssertions (similar to ObjectAssertionsExtensions in FluentAssertions.Json):

public AndConstraint<TAssertions> BeJsonSerializable(string because = "", params object[] becauseArgs);
public AndConstraint<TAssertions> BeJsonSerializable<T>(string because = "", params object[] becauseArgs);
public AndConstraint<TAssertions> BeJsonSerializable<T>(Func<EquivalencyOptions<T>, EquivalencyOptions<T>> options, string because = "", params object[] becauseArgs)

These methods should assert that an object can be serialized to and deserialized from JSON and retains the values of all members.

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

Copy link

github-actions bot commented Jan 14, 2024

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vbreuss vbreuss force-pushed the topic/json-support/be-json-serializable branch from 3e6e081 to 656af71 Compare January 14, 2024 07:38
@coveralls
Copy link

coveralls commented Jan 14, 2024

Pull Request Test Coverage Report for Build 7521248985

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 97.43%

Totals Coverage Status
Change from base Build 7520600368: -0.03%
Covered Lines: 11961
Relevant Lines: 12151

💛 - Coveralls

@vbreuss vbreuss force-pushed the topic/json-support/be-json-serializable branch 5 times, most recently from 436a127 to 82e6e49 Compare January 14, 2024 15:50
@vbreuss vbreuss force-pushed the topic/json-support/be-json-serializable branch from 82e6e49 to a695d8a Compare January 14, 2024 19:21
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.

None yet

2 participants