Skip to content

Commit

Permalink
Fix unsing of AnyNotes()
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergHoffmannatGitHub committed Jan 29, 2023
1 parent bb88513 commit 37b56bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FamilySearch.Api/Ft/ChildAndParentsRelationshipState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public Note Note
get
{
ChildAndParentsRelationship relationship = Relationship;
return relationship == null ? null : relationship.Notes == null ? null : relationship.Notes.FirstOrDefault();
return relationship == null ? null : relationship.AnyNotes() ? null : relationship.Notes.FirstOrDefault();
}
}

Expand Down
3 changes: 1 addition & 2 deletions Gedcomx.Rs.Api.Test/NotesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public void TestReadNote()
Assert.DoesNotThrow(() => state.IfSuccessful());
Assert.That(state.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK));
Assert.That(state.Person, Is.Not.Null);
Assert.That(state.Person.Notes, Is.Not.Null);
Assert.That(state.Person.Notes, Is.Not.Empty);
Assert.That(state.Person.AnyNotes(), Is.True);
}

[Test]
Expand Down
3 changes: 1 addition & 2 deletions Gedcomx.Rs.Api.Test/PersonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ public void TestReadNotes()
var state2 = state.LoadNotes();
Assert.DoesNotThrow(() => state2.IfSuccessful());
Assert.That(state2.Person, Is.Not.Null);
Assert.That(state2.Person.Notes, Is.Not.Null);
Assert.That(state2.Person.Notes, Is.Not.Empty);
Assert.That(state2.Person.AnyNotes(), Is.True);
}

[Test, Category("AccountNeeded")]
Expand Down
2 changes: 1 addition & 1 deletion Gedcomx.Rs.Api.Test/SpouseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void TestReadCoupleRelationshipNotes()

Assert.DoesNotThrow(() => state.IfSuccessful());
Assert.That(state.Response.StatusCode, Is.EqualTo(HttpStatusCode.OK));
Assert.That(state.Relationship.Notes, Is.Not.Null);
Assert.That(state.Relationship.AnyNotes(), Is.True);
Assert.That(state.Relationship.Notes, Has.Count.EqualTo(1));
}

Expand Down

0 comments on commit 37b56bc

Please sign in to comment.