@@ -21,7 +21,7 @@ public void CopyFromDoesNotLoseAvatar()
21
21
var userImage = AvatarProvider . CreateBitmapImage ( "pack://application:,,,/GitHub.App;component/Images/default_user_avatar.png" ) ;
22
22
var orgImage = AvatarProvider . CreateBitmapImage ( "pack://application:,,,/GitHub.App;component/Images/default_org_avatar.png" ) ;
23
23
24
- var bitmapImageObservable = new Subject < BitmapImage > ( ) ;
24
+ var initialBitmapImageSubject = new Subject < BitmapImage > ( ) ;
25
25
26
26
var collectionEvent = new ManualResetEvent ( false ) ;
27
27
var avatarPropertyEvent = new ManualResetEvent ( false ) ;
@@ -30,7 +30,7 @@ public void CopyFromDoesNotLoseAvatar()
30
30
const string login = "foo" ;
31
31
const int initialOwnedPrivateRepositoryCount = 1 ;
32
32
33
- var initialAccount = new Account ( login , true , false , initialOwnedPrivateRepositoryCount , 0 , bitmapImageObservable ) ;
33
+ var initialAccount = new Account ( login , true , false , initialOwnedPrivateRepositoryCount , 0 , initialBitmapImageSubject ) ;
34
34
35
35
//Creating the test collection
36
36
var col = new TrackingCollection < IAccount > ( Observable . Empty < IAccount > ( ) , OrderedComparer < IAccount > . OrderByDescending ( x => x . Login ) . Compare ) ;
@@ -63,7 +63,8 @@ public void CopyFromDoesNotLoseAvatar()
63
63
} ) ;
64
64
65
65
//Providing the first avatar
66
- bitmapImageObservable . OnNext ( userImage ) ;
66
+ initialBitmapImageSubject . OnNext ( userImage ) ;
67
+ initialBitmapImageSubject . OnCompleted ( ) ;
67
68
68
69
//Waiting for the avatar to be added
69
70
avatarPropertyEvent . WaitOne ( ) ;
@@ -76,7 +77,8 @@ public void CopyFromDoesNotLoseAvatar()
76
77
77
78
//Creating an account update
78
79
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 ) ;
80
82
81
83
//Updating the account in the collection
82
84
col . AddItem ( updatedAccount ) ;
@@ -86,7 +88,8 @@ public void CopyFromDoesNotLoseAvatar()
86
88
collectionEvent . Reset ( ) ;
87
89
88
90
//Providing the second avatar
89
- bitmapImageObservable . OnNext ( orgImage ) ;
91
+ updatedBitmapImageSubject . OnNext ( orgImage ) ;
92
+ updatedBitmapImageSubject . OnCompleted ( ) ;
90
93
91
94
//Waiting for the delayed bitmap image observable
92
95
avatarPropertyEvent . WaitOne ( ) ;
0 commit comments