@@ -583,7 +583,7 @@ await ProvisioningDeviceClientInvalidGlobalAddressRegisterFailAsync(
583583
584584 #endregion InvalidGlobalAddress
585585
586- public async Task ProvisioningDeviceClient_ValidRegistrationId_Register_Ok (
586+ private async Task ProvisioningDeviceClient_ValidRegistrationId_Register_Ok (
587587 IotHubClientTransportSettings transportSettings ,
588588 AttestationMechanismType attestationType ,
589589 EnrollmentType ? enrollmentType ,
@@ -605,7 +605,7 @@ await ProvisioningDeviceClientValidRegistrationIdRegisterOkAsync(
605605 . ConfigureAwait ( false ) ;
606606 }
607607
608- public async Task ProvisioningDeviceClient_ValidRegistrationId_Register_Ok (
608+ private async Task ProvisioningDeviceClient_ValidRegistrationId_Register_Ok (
609609 IotHubClientTransportSettings transportSettings ,
610610 AttestationMechanismType attestationType ,
611611 EnrollmentType ? enrollmentType ,
@@ -694,7 +694,7 @@ private async Task ProvisioningDeviceClientValidRegistrationIdRegisterOkAsync(
694694 try
695695 {
696696 result = await provClient . RegisterAsync ( cts . Token ) . ConfigureAwait ( false ) ;
697- deviceId = result . DeviceId ;
697+ deviceId = result . DeviceId ;
698698 break ;
699699 }
700700 // Catching all ProvisioningClientException as the status code is not the same for Mqtt, Amqp and Http.
@@ -722,17 +722,17 @@ private async Task ProvisioningDeviceClientValidRegistrationIdRegisterOkAsync(
722722 {
723723 VerboseTestLogger . WriteLine ( $ "Deleting test enrollment type { attestationType } -{ enrollmentType } with registration Id { auth . GetRegistrationId ( ) } .") ;
724724 await DeleteCreatedEnrollmentAsync ( enrollmentType , auth , groupId ) . ConfigureAwait ( false ) ;
725- if ( deviceId != null )
726- {
727- VerboseTestLogger . WriteLine ( $ "Deleting device { deviceId } ...") ;
728- await TestDevice . ServiceClient . Devices . DeleteAsync ( deviceId ) . ConfigureAwait ( false ) ;
729- }
730725 }
731726 else
732727 {
733728 VerboseTestLogger . WriteLine ( $ "The test enrollment type { attestationType } -{ enrollmentType } with group Id { groupId } is currently hardcoded - do not delete.") ;
734729 }
735730
731+ if ( deviceId != null )
732+ {
733+ await TestDevice . ServiceClient . Devices . DeleteAsync ( deviceId ) . ConfigureAwait ( false ) ;
734+ }
735+
736736 if ( authMethod is AuthenticationProviderX509 x509Auth )
737737 {
738738 X509Certificate2 deviceCertificate = x509Auth . ClientCertificate ;
0 commit comments