Skip to content

Commit

Permalink
only exclude Sense.PartOfSpeech.Predefined from equality test
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jan 10, 2025
1 parent 52e2f3f commit dd0c5a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/FwLite/MiniLcm.Tests/CreateEntryTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ public async Task CanCreateEntry_AutoFaker()
.For(e => e.ComplexForms).Exclude(e => e.Id)
//predefined is always true in fwdata bridge, so we need to exclude it for now
.For(e => e.Senses).For(s => s.SemanticDomains).Exclude(s => s.Predefined)
// TODO: Figure out how to exclude just PartOfSpeech.Predefined
// .For(e => e.Senses).Exclude(s => s.PartOfSpeech.Predefined)); // rejected because PartOfSpeech could be null
// .For(e => e.Senses).Exclude(s => s.PartOfSpeech?.Predefined)); // not allowed because "An expression tree lambda may not contain a null propagating operator."
.For(e => e.Senses).Exclude(s => s.PartOfSpeech)); // Not ideal but best we can do for now
.For(e => e.Senses).Exclude(s => s.PartOfSpeech!.Predefined)
);
}

[Fact]
Expand Down

0 comments on commit dd0c5a9

Please sign in to comment.