@@ -59,7 +59,15 @@ public void Test_StringExtensions_ToVector2_XYZW(float x, float y)
5959
6060 [ TestCategory ( "StringExtensions" ) ]
6161 [ 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 ]
6371 [ DataRow ( "Hello" ) ]
6472 [ DataRow ( "1, 2, 3" ) ]
6573 [ DataRow ( "<1, 2, 3" ) ]
@@ -117,11 +125,28 @@ public void Test_StringExtensions_ToVector3_XYZW(float x, float y, float z)
117125
118126 [ TestCategory ( "StringExtensions" ) ]
119127 [ 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 ]
121146 [ DataRow ( "Hello" ) ]
122- [ DataRow ( "1, 2 " ) ]
147+ [ DataRow ( "1, " ) ]
123148 [ DataRow ( "1, 2, 3, 99" ) ]
124- [ DataRow ( "< 1, 2>" ) ]
149+ [ DataRow ( "1, 2>" ) ]
125150 [ DataRow ( "<1, 2, 3" ) ]
126151 [ DataRow ( "<1, 2, 3, 4>" ) ]
127152 [ ExpectedException ( typeof ( FormatException ) ) ]
@@ -179,12 +204,38 @@ public void Test_StringExtensions_ToVector4_XYZW(float x, float y, float z, floa
179204
180205 [ TestCategory ( "StringExtensions" ) ]
181206 [ 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 ]
183234 [ DataRow ( "Hello" ) ]
184- [ DataRow ( "1, 2" ) ]
185- [ DataRow ( "1, 2, 3" ) ]
235+ [ DataRow ( "1, 2, " ) ]
236+ [ DataRow ( "1, 2, 3, " ) ]
186237 [ DataRow ( "1, 2, 3, 99, 100" ) ]
187- [ DataRow ( "<1, 2, 3> " ) ]
238+ [ DataRow ( "<1, 2, 3" ) ]
188239 [ DataRow ( "<1, 2, 3, 4" ) ]
189240 [ DataRow ( "<1, 2, 3, 4, 5>" ) ]
190241 [ ExpectedException ( typeof ( FormatException ) ) ]
@@ -223,7 +274,15 @@ public void Test_StringExtensions_ToQuaternion_XYZW(float x, float y, float z, f
223274
224275 [ TestCategory ( "StringExtensions" ) ]
225276 [ 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 ]
227286 [ DataRow ( "Hello" ) ]
228287 [ DataRow ( "1, 2" ) ]
229288 [ DataRow ( "1, 2, 3" ) ]
0 commit comments