@@ -22,7 +22,6 @@ public void SetUp()
2222 }
2323
2424 #endregion SetUp
25-
2625 [ Test ]
2726 public void MapTo_CorrectDestinationAndSourceExpressions_MappedCorrectly ( )
2827 {
@@ -34,8 +33,8 @@ public void MapTo_CorrectDestinationAndSourceExpressions_MappedCorrectly()
3433
3534 // Act & Assert
3635
37- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
38- Assert . AreEqual ( dto . Type , source . Category ) ;
36+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
37+ Assert . That ( dto . Type , Is . EqualTo ( source . Category ) ) ;
3938 }
4039
4140 [ Test ]
@@ -47,11 +46,11 @@ public void MapTo_CorrectDestinationAndSourceExpressions_ValidMappingCreated()
4746
4847 // Act & Assert
4948
50- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
49+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
5150 . MapTo ( d => d . Type , s => s . Category )
52- . MapTo ( d => d . Source , s => s ) ) ) ;
53- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
54- Assert . DoesNotThrow ( ( ) => cfg . CreateMapper ( ) ) ;
51+ . MapTo ( d => d . Source , s => s ) ) , Throws . Nothing ) ;
52+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
53+ Assert . That ( ( ) => cfg . CreateMapper ( ) , Throws . Nothing ) ;
5554 }
5655
5756 [ Test ]
@@ -65,8 +64,8 @@ public void MapTo_CorrectDestinationExpressionAndSourcePath_MappedCorrectly()
6564
6665 // Act & Assert
6766
68- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
69- Assert . AreEqual ( dto . Type , source . Category ) ;
67+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
68+ Assert . That ( dto . Type , Is . EqualTo ( source . Category ) ) ;
7069 }
7170
7271 [ Test ]
@@ -78,11 +77,11 @@ public void MapTo_CorrectDestinationExpressionAndSourcePath_ValidMappingCreated(
7877
7978 // Act & Assert
8079
81- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
80+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
8281 . MapTo ( d => d . Type , "Category" )
83- . MapTo ( d => d . Source , s => s ) ) ) ;
84- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
85- Assert . DoesNotThrow ( ( ) => cfg . CreateMapper ( ) ) ;
82+ . MapTo ( d => d . Source , s => s ) ) , Throws . Nothing ) ;
83+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
84+ Assert . That ( ( ) => cfg . CreateMapper ( ) , Throws . Nothing ) ;
8685 }
8786
8887 [ Test ]
@@ -94,14 +93,14 @@ public void MapTo_NullDestinationMemberExpression_ThrowsAutoMapperConfigurationE
9493
9594 // Act & Assert
9695
97- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
98- . MapTo ( nullDestinationExpression ! , s => s . Category ) ) ) ;
96+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
97+ . MapTo ( nullDestinationExpression ! , s => s . Category ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
9998
100- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
101- . MapTo ( nullDestinationExpression ! , "Category" ) ) ) ;
99+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
100+ . MapTo ( nullDestinationExpression ! , "Category" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
102101
103- Assert . Throws < ArgumentException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
104- . MapTo ( d => null , s => s . Category ) ) ) ;
102+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
103+ . MapTo ( d => null , s => s . Category ) ) , Throws . TypeOf < ArgumentException > ( ) ) ;
105104 }
106105
107106 [ Test ]
@@ -113,19 +112,19 @@ public void MapTo_NullOrEmptyDestinationMemberName_ThrowsAutoMapperConfiguration
113112
114113 // Act & Assert
115114
116- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
117- . MapTo ( nullDestinationName ! , s => s . Category ) ) ) ;
118- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
119- . MapTo ( "" , s => s . Category ) ) ) ;
120- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
121- . MapTo ( " " , s => s . Category ) ) ) ;
122-
123- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
124- . MapTo ( nullDestinationName ! , "Category" ) ) ) ;
125- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
126- . MapTo ( "" , "Category" ) ) ) ;
127- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
128- . MapTo ( " " , "Category" ) ) ) ;
115+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
116+ . MapTo ( nullDestinationName ! , s => s . Category ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
117+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
118+ . MapTo ( "" , s => s . Category ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
119+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
120+ . MapTo ( " " , s => s . Category ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
121+
122+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
123+ . MapTo ( nullDestinationName ! , "Category" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
124+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
125+ . MapTo ( "" , "Category" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
126+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
127+ . MapTo ( " " , "Category" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
129128 }
130129
131130 [ Test ]
@@ -137,19 +136,19 @@ public void MapTo_NullOrEmptySourceMemberPath_ThrowsAutoMapperConfigurationExcep
137136
138137 // Act & Assert
139138
140- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
141- . MapTo ( d => d . Type , nullSourcePath ! ) ) ) ;
142- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
143- . MapTo ( d => d . Type , "" ) ) ) ;
144- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
145- . MapTo ( d => d . Type , " " ) ) ) ;
146-
147- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
148- . MapTo ( "Type" , nullSourcePath ! ) ) ) ;
149- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
150- . MapTo ( "Type" , "" ) ) ) ;
151- Assert . Throws < AutoMapperConfigurationException > ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
152- . MapTo ( "Type" , " " ) ) ) ;
139+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
140+ . MapTo ( d => d . Type , nullSourcePath ! ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
141+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
142+ . MapTo ( d => d . Type , "" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
143+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
144+ . MapTo ( d => d . Type , " " ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
145+
146+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
147+ . MapTo ( "Type" , nullSourcePath ! ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
148+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
149+ . MapTo ( "Type" , "" ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
150+ Assert . That ( ( ) => new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
151+ . MapTo ( "Type" , " " ) ) , Throws . TypeOf < AutoMapperConfigurationException > ( ) ) ;
153152 }
154153
155154 [ Test ]
@@ -165,8 +164,8 @@ public void MapTo_NullSourceMemberExpression_MappedCorrectly()
165164
166165 // Act & Assert
167166
168- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
169- Assert . AreEqual ( dto . Source , source . ToString ( ) ) ;
167+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
168+ Assert . That ( dto . Source , Is . EqualTo ( source . ToString ( ) ) ) ;
170169
171170 // Arrange
172171
@@ -176,8 +175,8 @@ public void MapTo_NullSourceMemberExpression_MappedCorrectly()
176175
177176 // Act & Assert
178177
179- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
180- Assert . AreEqual ( dto . Source , source . ToString ( ) ) ;
178+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
179+ Assert . That ( dto . Source , Is . EqualTo ( source . ToString ( ) ) ) ;
181180 }
182181
183182 [ Test ]
@@ -190,15 +189,15 @@ public void MapTo_NullSourceMemberExpression_ValidMappingCreated()
190189
191190 // Act & Assert
192191
193- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
192+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
194193 . MapTo ( d => d . Type , nullSourceExpression )
195- . MapTo ( d => d . Source , nullSourceExpression ) ) ) ;
196- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
194+ . MapTo ( d => d . Source , nullSourceExpression ) ) , Throws . Nothing ) ;
195+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
197196
198- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
197+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
199198 . MapTo ( "Type" , nullSourceExpression )
200- . MapTo ( d => d . Source , nullSourceExpression ) ) ) ;
201- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
199+ . MapTo ( d => d . Source , nullSourceExpression ) ) , Throws . Nothing ) ;
200+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
202201 }
203202
204203 [ Test ]
@@ -212,8 +211,8 @@ public void MapTo_NullValueSourceMemberExpression_MappedCorrectly()
212211
213212 // Act & Assert
214213
215- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
216- Assert . AreEqual ( dto . Type , null ) ;
214+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
215+ Assert . That ( dto . Type , Is . Null ) ;
217216
218217 // Arrange
219218
@@ -223,8 +222,8 @@ public void MapTo_NullValueSourceMemberExpression_MappedCorrectly()
223222
224223 // Act & Assert
225224
226- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
227- Assert . AreEqual ( dto . Type , null ) ;
225+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
226+ Assert . That ( dto . Type , Is . Null ) ;
228227 }
229228
230229 [ Test ]
@@ -236,15 +235,15 @@ public void MapTo_NullValueSourceMemberExpression_ValidMappingCreated()
236235
237236 // Act & Assert
238237
239- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
238+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
240239 . MapTo ( d => d . Type , s => null )
241- . MapTo ( d => d . Source , s => null ) ) ) ;
242- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
240+ . MapTo ( d => d . Source , s => null ) ) , Throws . Nothing ) ;
241+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
243242
244- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
243+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
245244 . MapTo ( "Type" , s => null )
246- . MapTo ( "Source" , s => null ) ) ) ;
247- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
245+ . MapTo ( "Source" , s => null ) ) , Throws . Nothing ) ;
246+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
248247 }
249248
250249 [ Test ]
@@ -258,8 +257,8 @@ public void MapTo_WithoutSourceMemberExpression_MappedCorrectly()
258257
259258 // Act & Assert
260259
261- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
262- Assert . AreEqual ( dto . Source , source . ToString ( ) ) ;
260+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
261+ Assert . That ( dto . Source , Is . EqualTo ( source . ToString ( ) ) ) ;
263262
264263 // Arrange
265264
@@ -269,8 +268,8 @@ public void MapTo_WithoutSourceMemberExpression_MappedCorrectly()
269268
270269 // Act & Assert
271270
272- Assert . NotNull ( dto = mapper . Map < FoodDto > ( source ) ) ;
273- Assert . AreEqual ( dto . Source , source . ToString ( ) ) ;
271+ Assert . That ( dto = mapper . Map < FoodDto > ( source ) , Is . Not . Null ) ;
272+ Assert . That ( dto . Source , Is . EqualTo ( source . ToString ( ) ) ) ;
274273 }
275274
276275 [ Test ]
@@ -282,14 +281,14 @@ public void MapTo_WithoutSourceMemberExpression_ValidMappingCreated()
282281
283282 // Act & Assert
284283
285- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
284+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
286285 . MapTo ( d => d . Type )
287- . MapTo ( d => d . Source ) ) ) ;
288- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
286+ . MapTo ( d => d . Source ) ) , Throws . Nothing ) ;
287+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
289288
290- Assert . DoesNotThrow ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
289+ Assert . That ( ( ) => cfg = new MapperConfiguration ( c => c . CreateMap < FoodSource , FoodDto > ( )
291290 . MapTo ( "Type" )
292- . MapTo ( "Source" ) ) ) ;
293- Assert . DoesNotThrow ( ( ) => cfg . AssertConfigurationIsValid ( ) ) ;
291+ . MapTo ( "Source" ) ) , Throws . Nothing ) ;
292+ Assert . That ( ( ) => cfg . AssertConfigurationIsValid ( ) , Throws . Nothing ) ;
294293 }
295294}
0 commit comments