Skip to content

Comparing Resources using FluentAssertions #2498

Answered by ewoutkramer
LodewijkSioen asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, it took me ages before I understood the fine details of FluentAssertions in this regard. It actually works much better if you use BeEquivalentTo() with anonymous objects, so e.g.

Patient p = new()
{
	Deceased = new FhirBoolean(true)
};

p.Should().BeEquivalentTo(new { Deceased = new FhirBoolean(true) });

Note the new {}, not new Patient {}.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@LodewijkSioen
Comment options

@ewoutkramer
Comment options

Answer selected by ewoutkramer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants