@@ -21,7 +21,7 @@ public void CopyFromDoesNotLoseAvatar()
2121 var userImage = AvatarProvider . CreateBitmapImage ( "pack://application:,,,/GitHub.App;component/Images/default_user_avatar.png" ) ;
2222 var orgImage = AvatarProvider . CreateBitmapImage ( "pack://application:,,,/GitHub.App;component/Images/default_org_avatar.png" ) ;
2323
24- var bitmapImageObservable = new Subject < BitmapImage > ( ) ;
24+ var initialBitmapImageSubject = new Subject < BitmapImage > ( ) ;
2525
2626 var collectionEvent = new ManualResetEvent ( false ) ;
2727 var avatarPropertyEvent = new ManualResetEvent ( false ) ;
@@ -30,7 +30,7 @@ public void CopyFromDoesNotLoseAvatar()
3030 const string login = "foo" ;
3131 const int initialOwnedPrivateRepositoryCount = 1 ;
3232
33- var initialAccount = new Account ( login , true , false , initialOwnedPrivateRepositoryCount , 0 , bitmapImageObservable ) ;
33+ var initialAccount = new Account ( login , true , false , initialOwnedPrivateRepositoryCount , 0 , initialBitmapImageSubject ) ;
3434
3535 //Creating the test collection
3636 var col = new TrackingCollection < IAccount > ( Observable . Empty < IAccount > ( ) , OrderedComparer < IAccount > . OrderByDescending ( x => x . Login ) . Compare ) ;
@@ -63,7 +63,8 @@ public void CopyFromDoesNotLoseAvatar()
6363 } ) ;
6464
6565 //Providing the first avatar
66- bitmapImageObservable . OnNext ( userImage ) ;
66+ initialBitmapImageSubject . OnNext ( userImage ) ;
67+ initialBitmapImageSubject . OnCompleted ( ) ;
6768
6869 //Waiting for the avatar to be added
6970 avatarPropertyEvent . WaitOne ( ) ;
@@ -76,7 +77,8 @@ public void CopyFromDoesNotLoseAvatar()
7677
7778 //Creating an account update
7879 const int updatedOwnedPrivateRepositoryCount = 2 ;
79- var updatedAccount = new Account ( login , true , false , updatedOwnedPrivateRepositoryCount , 0 , bitmapImageObservable ) ;
80+ var updatedBitmapImageSubject = new Subject < BitmapImage > ( ) ;
81+ var updatedAccount = new Account ( login , true , false , updatedOwnedPrivateRepositoryCount , 0 , updatedBitmapImageSubject ) ;
8082
8183 //Updating the account in the collection
8284 col . AddItem ( updatedAccount ) ;
@@ -86,7 +88,8 @@ public void CopyFromDoesNotLoseAvatar()
8688 collectionEvent . Reset ( ) ;
8789
8890 //Providing the second avatar
89- bitmapImageObservable . OnNext ( orgImage ) ;
91+ updatedBitmapImageSubject . OnNext ( orgImage ) ;
92+ updatedBitmapImageSubject . OnCompleted ( ) ;
9093
9194 //Waiting for the delayed bitmap image observable
9295 avatarPropertyEvent . WaitOne ( ) ;
0 commit comments