File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -487,25 +487,28 @@ public async Task LLP_PushAsync_Replacement_Works()
487487 [ Fact ]
488488 public async Task LLP_ModifyAfterInsertInNewContext_NoPush_ShouldUpdateOperationsQueue ( )
489489 {
490- // Arrange
491490 await using SqliteConnection connection = CreateAndOpenConnection ( ) ;
492491 string id = Guid . NewGuid ( ) . ToString ( "N" ) ;
493492 await using ( TestDbContext llpContext = CreateContext ( connection , x => x . UseLazyLoadingProxies ( ) ) )
494493 {
495- ClientMovie clientMovie = new ( TestData . Movies . BlackPanther ) { Id = id } ;
494+ ClientMovie clientMovie = new ( TestData . Movies . MovieList [ 0 ] . Title ) { Id = id } ;
496495 llpContext . Movies . Add ( clientMovie ) ;
497496 llpContext . SaveChanges ( ) ;
498497 }
499498
500- // Act
501499 await using TestDbContext newLlpContext = CreateContext ( connection , x => x . UseLazyLoadingProxies ( ) ) ;
502500
503501 ClientMovie storedClientMovie = newLlpContext . Movies . First ( m => m . Id == id ) ;
504- storedClientMovie . Title = TestData . Movies . MovieList [ 0 ] . Title ;
502+
503+ // ensure that it is a lazy loading proxy and not exactly a ClientMovie
504+ storedClientMovie . GetType ( ) . Should ( ) . NotBe ( typeof ( ClientMovie ) )
505+ . And . Subject . Namespace . Should ( ) . Be ( "Castle.Proxies" ) ;
506+
507+ storedClientMovie . Title = TestData . Movies . MovieList [ 1 ] . Title ;
505508 newLlpContext . SaveChanges ( ) ;
506509
507- // Assert
508- newLlpContext . DatasyncOperationsQueue . Should ( ) . ContainSingle ( op => op . ItemId == id ) ;
510+ newLlpContext . DatasyncOperationsQueue . Should ( ) . ContainSingle ( op => op . ItemId == id )
511+ . Which . EntityType . Should ( ) . NotContain ( "Castle.Proxies" ) ;
509512 }
510513 #endregion
511514}
You can’t perform that action at this time.
0 commit comments