This repository was archived by the owner on Aug 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
tests/JpProject.Domain.Tests/ClientTests Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,13 @@ public async Task ShouldNotAcceptNegativeDeviceCodeLifetime()
176176 public async Task ShouldUpdateClient ( )
177177 {
178178 var command = ClientCommandFaker . GenerateUpdateClientCommand ( ) . Generate ( ) ;
179- _clientRepository . Setup ( s => s . UpdateWithChildrens ( It . Is < Client > ( a => a . ClientId == command . Client . ClientId ) ) ) . Returns ( Task . CompletedTask ) ;
180- _clientRepository . Setup ( s => s . GetClient ( It . Is < string > ( a => a == command . Client . ClientId ) ) ) . ReturnsAsync ( EntityClientFaker . GenerateClient ( ) . Generate ( ) ) ;
179+
180+ var clientId = command . Client . ClientId == command . OldClientId
181+ ? command . Client . ClientId
182+ : command . OldClientId ;
183+
184+ _clientRepository . Setup ( s => s . UpdateWithChildrens ( It . Is < Client > ( a => a . ClientId == clientId ) ) ) . Returns ( Task . CompletedTask ) ;
185+ _clientRepository . Setup ( s => s . GetClient ( It . Is < string > ( a => a == clientId ) ) ) . ReturnsAsync ( EntityClientFaker . GenerateClient ( ) . Generate ( ) ) ;
181186 _uow . Setup ( s => s . Commit ( ) ) . Returns ( true ) ;
182187
183188 var result = await _commandHandler . Handle ( command , _tokenSource . Token ) ;
You can’t perform that action at this time.
0 commit comments