@@ -76,14 +76,14 @@ public async Task ShouldNotUpdateResourceWhenItDoesntExist()
7676 {
7777 var command = ResourceCommandFaker . GenerateUpdateApiResourceCommand ( ) . Generate ( ) ;
7878
79- _apiResourceRepository . Setup ( s => s . GetResource ( It . Is < string > ( q => q == command . Resource . Name ) ) ) . ReturnsAsync ( EntityResourceFaker . GenerateResource ( ) . Generate ( ) ) ;
79+ _apiResourceRepository . Setup ( s => s . GetResource ( It . Is < string > ( q => q == command . OldResourceName ) ) ) . ReturnsAsync ( EntityResourceFaker . GenerateResource ( ) . Generate ( ) ) ;
8080
8181
8282 var result = await _commandHandler . Handle ( command , _tokenSource . Token ) ;
8383
8484
8585 Assert . False ( result ) ;
86- _apiResourceRepository . Verify ( s => s . GetResource ( It . Is < string > ( q => q == command . Resource . Name ) ) , Times . Once ) ;
86+ _apiResourceRepository . Verify ( s => s . GetResource ( It . Is < string > ( q => q == command . OldResourceName ) ) , Times . Once ) ;
8787 }
8888
8989
@@ -133,17 +133,17 @@ public async Task ShouldNotRemoveResourceWhenNameIsntProvided()
133133 [ Fact ]
134134 public async Task ShouldNotRemoveResourceWhenItDoesntExist ( )
135135 {
136- var command = ResourceCommandFaker . GenerateUpdateApiResourceCommand ( ) . Generate ( ) ;
137136
138- _apiResourceRepository . Setup ( s => s . GetResource ( It . Is < string > ( q => q == command . Resource . Name ) ) ) . ReturnsAsync ( ( ApiResource ) null ) ;
137+ var command = ResourceCommandFaker . GenerateUpdateApiResourceCommand ( ) . Generate ( ) ;
139138
139+ _apiResourceRepository . Setup ( s => s . GetResource ( It . Is < string > ( q => q == command . OldResourceName ) ) ) . ReturnsAsync ( ( ApiResource ) null ) ;
140140
141141 var result = await _commandHandler . Handle ( command , _tokenSource . Token ) ;
142142
143143
144144 Assert . False ( result ) ;
145145 _uow . Verify ( v => v . Commit ( ) , Times . Never ) ;
146- _apiResourceRepository . Verify ( s => s . GetResource ( It . Is < string > ( q => q == command . Resource . Name ) ) , Times . Once ) ;
146+ _apiResourceRepository . Verify ( s => s . GetResource ( It . Is < string > ( q => q == command . OldResourceName ) ) , Times . Once ) ;
147147 }
148148
149149 [ Fact ]
0 commit comments