1
- using System ;
2
- using System . Linq ;
3
- using System . Threading . Tasks ;
4
- using System . Windows ;
5
1
using Prism . Navigation . Regions ;
6
2
using Prism . Navigation . Regions . Behaviors ;
7
3
using Prism . Wpf . Tests . Mocks ;
@@ -42,8 +38,8 @@ public void RegionWillNotGetCreatedTwiceWhenThereAreMoreRegions()
42
38
var adapter = new MockRegionAdapter ( ) ;
43
39
adapter . Accessor = accessor ;
44
40
45
- var behavior1 = this . GetBehavior ( control1 , accessor , adapter ) ;
46
- var behavior2 = this . GetBehavior ( control2 , accessor , adapter ) ;
41
+ var behavior1 = GetBehavior ( control1 , accessor , adapter ) ;
42
+ var behavior2 = GetBehavior ( control2 , accessor , adapter ) ;
47
43
48
44
behavior1 . Attach ( ) ;
49
45
behavior2 . Attach ( ) ;
@@ -68,9 +64,9 @@ public void RegionGetsCreatedWhenAccessingRegions()
68
64
GetRegionName = d => "myRegionName"
69
65
} ;
70
66
71
- var behavior1 = this . GetBehavior ( control1 , accessor ) ;
67
+ var behavior1 = GetBehavior ( control1 , accessor ) ;
72
68
behavior1 . Attach ( ) ;
73
- var behavior2 = this . GetBehavior ( control2 , accessor ) ;
69
+ var behavior2 = GetBehavior ( control2 , accessor ) ;
74
70
behavior2 . Attach ( ) ;
75
71
76
72
accessor . UpdateRegions ( ) ;
@@ -91,7 +87,7 @@ public void RegionDoesNotGetCreatedTwiceWhenUpdatingRegions()
91
87
GetRegionName = d => "myRegionName"
92
88
} ;
93
89
94
- var behavior = this . GetBehavior ( control , accessor ) ;
90
+ var behavior = GetBehavior ( control , accessor ) ;
95
91
behavior . Attach ( ) ;
96
92
accessor . UpdateRegions ( ) ;
97
93
IRegion region = RegionManager . GetObservableRegion ( control ) . Value ;
@@ -112,7 +108,7 @@ public async Task BehaviorDoesNotPreventControlFromBeingGarbageCollected()
112
108
GetRegionName = d => "myRegionName"
113
109
} ;
114
110
115
- var behavior = this . GetBehavior ( control , accessor ) ;
111
+ var behavior = GetBehavior ( control , accessor ) ;
116
112
behavior . Attach ( ) ;
117
113
118
114
Assert . True ( controlWeakReference . IsAlive ) ;
@@ -136,7 +132,7 @@ public async Task BehaviorDoesNotPreventControlFromBeingGarbageCollectedWhenRegi
136
132
GetRegionName = d => "myRegionName"
137
133
} ;
138
134
139
- var behavior = this . GetBehavior ( control , accessor ) ;
135
+ var behavior = GetBehavior ( control , accessor ) ;
140
136
behavior . Attach ( ) ;
141
137
accessor . UpdateRegions ( ) ;
142
138
@@ -159,7 +155,7 @@ public void BehaviorShouldUnhookEventWhenDetaching()
159
155
{
160
156
GetRegionName = d => "myRegionName" ,
161
157
} ;
162
- var behavior = this . GetBehavior ( control , accessor ) ;
158
+ var behavior = GetBehavior ( control , accessor ) ;
163
159
behavior . Attach ( ) ;
164
160
165
161
int startingCount = accessor . GetSubscribersCount ( ) ;
@@ -169,7 +165,7 @@ public void BehaviorShouldUnhookEventWhenDetaching()
169
165
Assert . Equal < int > ( startingCount - 1 , accessor . GetSubscribersCount ( ) ) ;
170
166
}
171
167
172
- [ StaFact ]
168
+ [ StaFact ( ) ]
173
169
public void ShouldCleanupBehaviorOnceRegionIsCreated ( )
174
170
{
175
171
var control = new MockFrameworkElement ( ) ;
@@ -180,7 +176,7 @@ public void ShouldCleanupBehaviorOnceRegionIsCreated()
180
176
GetRegionName = d => "myRegionName"
181
177
} ;
182
178
183
- var behavior = this . GetBehavior ( control , accessor ) ;
179
+ var behavior = GetBehavior ( control , accessor ) ;
184
180
WeakReference behaviorWeakReference = new WeakReference ( behavior ) ;
185
181
behavior . Attach ( ) ;
186
182
accessor . UpdateRegions ( ) ;
@@ -192,7 +188,7 @@ public void ShouldCleanupBehaviorOnceRegionIsCreated()
192
188
193
189
Assert . False ( behaviorWeakReference . IsAlive ) ;
194
190
195
- var behavior2 = this . GetBehavior ( control2 , accessor ) ;
191
+ var behavior2 = GetBehavior ( control2 , accessor ) ;
196
192
WeakReference behaviorWeakReference2 = new WeakReference ( behavior2 ) ;
197
193
behavior2 . Attach ( ) ;
198
194
accessor . UpdateRegions ( ) ;
0 commit comments