File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
LinkDotNet.Blog.Infrastructure/Persistence
LinkDotNet.Blog.UnitTests/Infrastructure/Persistence Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ public async Task<IPagedList<T>> GetAllAsync(
5858
5959 public async Task StoreAsync ( T entity )
6060 {
61+ await repository . StoreAsync ( entity ) ;
6162 ResetCache ( ) ;
6263 memoryCache . Set ( entity . Id , entity , Options ) ;
63- await repository . StoreAsync ( entity ) ;
6464 }
6565
6666 public async Task DeleteAsync ( string id )
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ await sut.GetAllAsync(
101101 public async Task ShouldUpdateCacheOnStore ( )
102102 {
103103 var blogPost = new BlogPostBuilder ( ) . Build ( ) ;
104- blogPost . Id = "id" ;
104+ repositoryMock . Setup ( r => r . StoreAsync ( blogPost ) )
105+ . Callback ( ( ) => blogPost . Id = "id" ) ;
105106 repositoryMock . Setup ( r => r . GetByIdAsync ( "id" ) ) . ReturnsAsync ( blogPost ) ;
106- await sut . GetByIdAsync ( "id" ) ;
107107 var update = new BlogPostBuilder ( ) . WithTitle ( "new" ) . Build ( ) ;
108108 blogPost . Update ( update ) ;
109109 await sut . StoreAsync ( blogPost ) ;
You can’t perform that action at this time.
0 commit comments