@@ -59,7 +59,15 @@ public void Test_StringExtensions_ToVector2_XYZW(float x, float y)
59
59
60
60
[ TestCategory ( "StringExtensions" ) ]
61
61
[ TestMethod ]
62
- [ DataRow ( "" ) ]
62
+ public void Test_StringExtensions_ToVector2_Zero ( )
63
+ {
64
+ var value = string . Empty . ToVector2 ( ) ;
65
+
66
+ Assert . AreEqual ( Vector2 . Zero , value ) ;
67
+ }
68
+
69
+ [ TestCategory ( "StringExtensions" ) ]
70
+ [ TestMethod ]
63
71
[ DataRow ( "Hello" ) ]
64
72
[ DataRow ( "1, 2, 3" ) ]
65
73
[ DataRow ( "<1, 2, 3" ) ]
@@ -117,11 +125,28 @@ public void Test_StringExtensions_ToVector3_XYZW(float x, float y, float z)
117
125
118
126
[ TestCategory ( "StringExtensions" ) ]
119
127
[ TestMethod ]
120
- [ DataRow ( "" ) ]
128
+ public void Test_StringExtensions_ToVector3_Zero ( )
129
+ {
130
+ var value = string . Empty . ToVector3 ( ) ;
131
+
132
+ Assert . AreEqual ( Vector3 . Zero , value ) ;
133
+ }
134
+
135
+ [ TestCategory ( "StringExtensions" ) ]
136
+ [ TestMethod ]
137
+ public void Test_StringExtensions_ToVector3_FromTwoValues ( )
138
+ {
139
+ var value = "4, 3" . ToVector3 ( ) ;
140
+
141
+ Assert . AreEqual ( new Vector3 ( new Vector2 ( 4 , 3 ) , 0 ) , value ) ;
142
+ }
143
+
144
+ [ TestCategory ( "StringExtensions" ) ]
145
+ [ TestMethod ]
121
146
[ DataRow ( "Hello" ) ]
122
- [ DataRow ( "1, 2 " ) ]
147
+ [ DataRow ( "1, " ) ]
123
148
[ DataRow ( "1, 2, 3, 99" ) ]
124
- [ DataRow ( "< 1, 2>" ) ]
149
+ [ DataRow ( "1, 2>" ) ]
125
150
[ DataRow ( "<1, 2, 3" ) ]
126
151
[ DataRow ( "<1, 2, 3, 4>" ) ]
127
152
[ ExpectedException ( typeof ( FormatException ) ) ]
@@ -179,12 +204,38 @@ public void Test_StringExtensions_ToVector4_XYZW(float x, float y, float z, floa
179
204
180
205
[ TestCategory ( "StringExtensions" ) ]
181
206
[ TestMethod ]
182
- [ DataRow ( "" ) ]
207
+ public void Test_StringExtensions_ToVector4_Zero ( )
208
+ {
209
+ var value = string . Empty . ToVector4 ( ) ;
210
+
211
+ Assert . AreEqual ( Vector4 . Zero , value ) ;
212
+ }
213
+
214
+ [ TestCategory ( "StringExtensions" ) ]
215
+ [ TestMethod ]
216
+ public void Test_StringExtensions_ToVector4_FromTwoValues ( )
217
+ {
218
+ var value = "4, 3" . ToVector4 ( ) ;
219
+
220
+ Assert . AreEqual ( new Vector4 ( new Vector2 ( 4 , 3 ) , 0 , 0 ) , value ) ;
221
+ }
222
+
223
+ [ TestCategory ( "StringExtensions" ) ]
224
+ [ TestMethod ]
225
+ public void Test_StringExtensions_ToVector4_FromThreeValues ( )
226
+ {
227
+ var value = "4, 3, -2" . ToVector4 ( ) ;
228
+
229
+ Assert . AreEqual ( new Vector4 ( new Vector3 ( 4 , 3 , - 2 ) , 0 ) , value ) ;
230
+ }
231
+
232
+ [ TestCategory ( "StringExtensions" ) ]
233
+ [ TestMethod ]
183
234
[ DataRow ( "Hello" ) ]
184
- [ DataRow ( "1, 2" ) ]
185
- [ DataRow ( "1, 2, 3" ) ]
235
+ [ DataRow ( "1, 2, " ) ]
236
+ [ DataRow ( "1, 2, 3, " ) ]
186
237
[ DataRow ( "1, 2, 3, 99, 100" ) ]
187
- [ DataRow ( "<1, 2, 3> " ) ]
238
+ [ DataRow ( "<1, 2, 3" ) ]
188
239
[ DataRow ( "<1, 2, 3, 4" ) ]
189
240
[ DataRow ( "<1, 2, 3, 4, 5>" ) ]
190
241
[ ExpectedException ( typeof ( FormatException ) ) ]
@@ -223,7 +274,15 @@ public void Test_StringExtensions_ToQuaternion_XYZW(float x, float y, float z, f
223
274
224
275
[ TestCategory ( "StringExtensions" ) ]
225
276
[ TestMethod ]
226
- [ DataRow ( "" ) ]
277
+ public void Test_StringExtensions_ToQuaternion_Zero ( )
278
+ {
279
+ var value = string . Empty . ToQuaternion ( ) ;
280
+
281
+ Assert . AreEqual ( default ( Quaternion ) , value ) ;
282
+ }
283
+
284
+ [ TestCategory ( "StringExtensions" ) ]
285
+ [ TestMethod ]
227
286
[ DataRow ( "Hello" ) ]
228
287
[ DataRow ( "1, 2" ) ]
229
288
[ DataRow ( "1, 2, 3" ) ]
0 commit comments