Browse Source

Updated Null tests to use new IsEmptyArray and IsEmptyString functions.

woollybah 5 years ago
parent
commit
b4b94ac105
1 changed files with 3 additions and 15 deletions
  1. 3 15
      maxunit.mod/maxunit.bmx

+ 3 - 15
maxunit.mod/maxunit.bmx

@@ -569,7 +569,7 @@ Type TAssert
 	about: If it is #Null, an #AssertionFailedException is thrown with the given message.
 	End Rem
 	Function assertNotNull(obj:Object, message:String = Null)
-		If obj = Null Then
+		If obj = Null Or IsEmptyArray(obj) Or IsEmptyString(obj) Then
 			fail("assertNotNull() : " + message)
 		End If
 	End Function
@@ -590,7 +590,7 @@ Type TAssert
 	If it is not #Null, an #AssertionFailedException is thrown with the given message.
 	End Rem
 	Function assertNull(obj:Object, message:String = Null)
-		If obj <> Null Then
+		If obj <> Null And Not IsEmptyArray(obj) And Not IsEmptyString(obj) Then
 			fail("assertNull() : " + message)
 		End If
 	End Function
@@ -729,16 +729,4 @@ Type TAssert
 		failNotEquals(String.fromSizeT(expected), String.fromSizeT(actual), "assertEquals() : " +message)
   	End Function
 
-	Function assertNull(obj:String, message:String = Null)
-		If obj <> Null Then
-			fail("assertNull() : " + message)
-		End If
-	End Function
-
-	Function assertNotNull(obj:String, message:String = Null)
-		If obj = Null Then
-			fail("assertNotNull() : " + message)
-		End If
-	End Function
-
-End Type
+End Type