@@ -59,8 +59,8 @@ public void CompileBatchDescriptor()
59
59
60
60
var assembly = _factory . Precompile ( batch ) ;
61
61
62
- Assert . IsNotNull ( assembly ) ;
63
- Assert . AreEqual ( 3 , assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) ) ;
62
+ Assert . That ( assembly , Is . Not . Null ) ;
63
+ Assert . That ( assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) , Is . EqualTo ( 3 ) ) ;
64
64
}
65
65
66
66
[ Test ]
@@ -72,20 +72,23 @@ public void DefaultEntryBehavior()
72
72
73
73
var descriptors = _factory . CreateDescriptors ( batch ) ;
74
74
75
- Assert . AreEqual ( 2 , descriptors . Count ) ;
76
- Assert . AreEqual ( 2 , descriptors [ 0 ] . Templates . Count ) ;
77
- Assert . AreEqual ( 2 , descriptors [ 1 ] . Templates . Count ) ;
78
-
79
- Assert . That (
80
- descriptors . Any (
81
- d =>
82
- d . Templates . Contains ( string . Format ( "Stub{0}Index.spark" , Path . DirectorySeparatorChar ) ) &&
83
- d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
84
- Assert . That (
85
- descriptors . Any (
86
- d =>
87
- d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
88
- d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
75
+ Assert . That ( descriptors . Count , Is . EqualTo ( 2 ) ) ;
76
+ Assert . Multiple ( ( ) =>
77
+ {
78
+ Assert . That ( descriptors [ 0 ] . Templates . Count , Is . EqualTo ( 2 ) ) ;
79
+ Assert . That ( descriptors [ 1 ] . Templates . Count , Is . EqualTo ( 2 ) ) ;
80
+
81
+ Assert . That (
82
+ descriptors . Any (
83
+ d =>
84
+ d . Templates . Contains ( string . Format ( "Stub{0}Index.spark" , Path . DirectorySeparatorChar ) ) &&
85
+ d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
86
+ Assert . That (
87
+ descriptors . Any (
88
+ d =>
89
+ d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
90
+ d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
91
+ } ) ;
89
92
}
90
93
91
94
[ Test ]
@@ -98,8 +101,8 @@ public void MultipleLayoutFiles()
98
101
99
102
var assembly = _factory . Precompile ( batch ) ;
100
103
101
- Assert . IsNotNull ( assembly ) ;
102
- Assert . AreEqual ( 4 , assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) ) ;
104
+ Assert . That ( assembly , Is . Not . Null ) ;
105
+ Assert . That ( assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) , Is . EqualTo ( 4 ) ) ;
103
106
}
104
107
105
108
[ Test ]
@@ -112,27 +115,30 @@ public void WildcardIncludeRules()
112
115
. For < StubController > ( ) . Layout ( "ajax" ) . Include ( "_*" ) ;
113
116
114
117
var descriptors = _factory . CreateDescriptors ( batch ) ;
115
- Assert . AreEqual ( 3 , descriptors . Count ) ;
116
- Assert . That (
117
- descriptors . Any (
118
- d =>
119
- d . Templates . Contains ( string . Format ( "Stub{0}Index.spark" , Path . DirectorySeparatorChar ) ) &&
120
- d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
121
- Assert . That (
122
- descriptors . Any (
123
- d =>
124
- d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
125
- d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
126
- Assert . That (
127
- descriptors . Any (
128
- d =>
129
- d . Templates . Contains ( string . Format ( "Stub{0}_Widget.spark" , Path . DirectorySeparatorChar ) ) &&
130
- d . Templates . Contains ( string . Format ( "Shared{0}ajax.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
118
+ Assert . That ( descriptors . Count , Is . EqualTo ( 3 ) ) ;
119
+ Assert . Multiple ( ( ) =>
120
+ {
121
+ Assert . That (
122
+ descriptors . Any (
123
+ d =>
124
+ d . Templates . Contains ( string . Format ( "Stub{0}Index.spark" , Path . DirectorySeparatorChar ) ) &&
125
+ d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
126
+ Assert . That (
127
+ descriptors . Any (
128
+ d =>
129
+ d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
130
+ d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
131
+ Assert . That (
132
+ descriptors . Any (
133
+ d =>
134
+ d . Templates . Contains ( string . Format ( "Stub{0}_Widget.spark" , Path . DirectorySeparatorChar ) ) &&
135
+ d . Templates . Contains ( string . Format ( "Shared{0}ajax.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
136
+ } ) ;
131
137
132
138
var assembly = _factory . Precompile ( batch ) ;
133
139
134
- Assert . IsNotNull ( assembly ) ;
135
- Assert . AreEqual ( 3 , assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) ) ;
140
+ Assert . That ( assembly , Is . Not . Null ) ;
141
+ Assert . That ( assembly . GetTypes ( ) . Count ( x => x . BaseType == typeof ( SparkView ) ) , Is . EqualTo ( 3 ) ) ;
136
142
}
137
143
138
144
[ Test ]
@@ -144,19 +150,22 @@ public void ExcludeRules()
144
150
145
151
var descriptors = _factory . CreateDescriptors ( batch ) ;
146
152
147
- Assert . AreEqual ( 2 , descriptors . Count ) ;
148
- Assert . AreEqual ( 2 , descriptors [ 0 ] . Templates . Count ) ;
149
- Assert . AreEqual ( 2 , descriptors [ 1 ] . Templates . Count ) ;
150
- Assert . That (
151
- descriptors . Any (
152
- d =>
153
- d . Templates . Contains ( string . Format ( "Stub{0}_Widget.spark" , Path . DirectorySeparatorChar ) ) &&
154
- d . Templates . Contains ( string . Format ( "Shared{0}ajax.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
155
- Assert . That (
156
- descriptors . Any (
157
- d =>
158
- d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
159
- d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
153
+ Assert . That ( descriptors . Count , Is . EqualTo ( 2 ) ) ;
154
+ Assert . Multiple ( ( ) =>
155
+ {
156
+ Assert . That ( descriptors [ 0 ] . Templates . Count , Is . EqualTo ( 2 ) ) ;
157
+ Assert . That ( descriptors [ 1 ] . Templates . Count , Is . EqualTo ( 2 ) ) ;
158
+ Assert . That (
159
+ descriptors . Any (
160
+ d =>
161
+ d . Templates . Contains ( string . Format ( "Stub{0}_Widget.spark" , Path . DirectorySeparatorChar ) ) &&
162
+ d . Templates . Contains ( string . Format ( "Shared{0}ajax.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
163
+ Assert . That (
164
+ descriptors . Any (
165
+ d =>
166
+ d . Templates . Contains ( string . Format ( "Stub{0}List.spark" , Path . DirectorySeparatorChar ) ) &&
167
+ d . Templates . Contains ( string . Format ( "Shared{0}default.spark" , Path . DirectorySeparatorChar ) ) ) ) ;
168
+ } ) ;
160
169
}
161
170
162
171
[ Test ]
@@ -165,9 +174,9 @@ public void FileWithoutSparkExtensionAreIgnored()
165
174
var batch = new SparkBatchDescriptor ( ) ;
166
175
batch . For < StubController > ( ) ;
167
176
var descriptors = _factory . CreateDescriptors ( batch ) ;
168
-
177
+
169
178
// no templates
170
- Assert . That ( descriptors . SelectMany ( d=> d . Templates ) . All ( t=> ! t . Contains ( "Helper" ) ) ) ;
179
+ Assert . That ( descriptors . SelectMany ( d => d . Templates ) . All ( t => ! t . Contains ( "Helper" ) ) ) ;
171
180
}
172
181
173
182
[ Test ]
@@ -176,12 +185,12 @@ public void ControllersWithHelpersGenerateAccessors()
176
185
var batch = new SparkBatchDescriptor ( ) ;
177
186
batch . For < FooController > ( ) . Include ( "index" ) ;
178
187
_factory . Engine . ViewFolder = new InMemoryViewFolder { { string . Format ( "foo{0}index.spark" , Path . DirectorySeparatorChar ) , "<p>foo</p>" } } ;
179
-
188
+
180
189
var descriptors = _factory . CreateDescriptors ( batch ) ;
181
190
182
- Assert . AreEqual ( 1 , descriptors . Count ) ;
183
- Assert . AreEqual ( 1 , descriptors [ 0 ] . Accessors . Count ) ;
184
- Assert . AreEqual ( typeof ( FooHelper ) . FullName + " Foo" , descriptors [ 0 ] . Accessors [ 0 ] . Property ) ;
191
+ Assert . That ( descriptors . Count , Is . EqualTo ( 1 ) ) ;
192
+ Assert . That ( descriptors [ 0 ] . Accessors . Count , Is . EqualTo ( 1 ) ) ;
193
+ Assert . That ( descriptors [ 0 ] . Accessors [ 0 ] . Property , Is . EqualTo ( typeof ( FooHelper ) . FullName + " Foo" ) ) ;
185
194
}
186
195
}
187
196
0 commit comments