Skip to content

DeepEquals: generate absent assertion #813

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 1 commit into from
Aug 29, 2022

Conversation

sofurihafe
Copy link
Member

Description

When we have two classes with fields in cross-reference relationship and these field models are reference models, for instance:

class A {
   B b;
}

class B {
   A a;
}

we do not generate assertions by current Deep Equals implementation.

This PR adds support for rendering an assertion in this case.
Also, there is a new test, which is disabled for now due to #812.

Fixes # (811)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

Run new ClassWithCrossReferenceRelationshipGenerated test.

Manual Scenario

  1. Set useAssembleModelGenerator to false,
  2. Enable ClassWithCrossReferenceRelationshipGeneratedTest,
  3. Run ClassWithCrossReferenceRelationshipGeneratedTest. Verify that assertTrue is present in the generated test.

@sofurihafe sofurihafe force-pushed the andrey-t/deepequals-assert-true branch from e5a5a01 to fcf7c58 Compare August 29, 2022 17:47
@sofurihafe sofurihafe enabled auto-merge (squash) August 29, 2022 17:57
@sofurihafe sofurihafe merged commit 7aebf61 into main Aug 29, 2022
@sofurihafe sofurihafe deleted the andrey-t/deepequals-assert-true branch August 29, 2022 18:12
@sofurihafe sofurihafe linked an issue Aug 30, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No assertions when there are no not reference fields
2 participants