Skip to content

Commit

Permalink
Changes following PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hortha committed Sep 29, 2023
1 parent 32e4f98 commit 30d7203
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public Task UpdatePerson(Action<UpdatePersonBuilder>? configure)

public class UpdatePersonBuilder
{
Guid? _personId = null;
(string FirstName, string MiddleName, string LastName)? _updatedName = null;
private Guid? _personId = null;
private (string FirstName, string MiddleName, string LastName)? _updatedName = null;

public UpdatePersonBuilder WithPersonId(Guid personId)
{
Expand All @@ -41,7 +41,12 @@ public UpdatePersonBuilder WithUpdatedName(string firstName, string middleName,

public async Task Execute(CrmTestData testData)
{
if (_personId is not null && _updatedName is not null)
if (_personId is null)
{
throw new InvalidOperationException("WithPersonId has not been set");
}

if (_updatedName is not null)
{
await testData.OrganizationService.ExecuteAsync(new UpdateRequest()
{
Expand Down

0 comments on commit 30d7203

Please sign in to comment.