LogIsTrue Method (Boolean, String, String, String) | |
Check to be condition has true.
Namespace:
SIC.Test.Helper
Assembly:
SIC.Test.Helper (in SIC.Test.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax public void IsTrue(
bool pCondition,
string pConditionText,
string pMessageFailed = "",
string pMessageSuccessful = ""
)
Public Sub IsTrue (
pCondition As Boolean,
pConditionText As String,
Optional pMessageFailed As String = "",
Optional pMessageSuccessful As String = ""
)
Parameters
- pCondition
- Type: SystemBoolean
Condition to be checked (result: true or false) - pConditionText
- Type: SystemString
Description of condition - pMessageFailed (Optional)
- Type: SystemString
Text for failed test (examples: "is null" or "The result should be X") - pMessageSuccessful (Optional)
- Type: SystemString
Text for successful test
Remarks
When test failed then puts HasFailed.
Message text adds to ResultMessage
Examples
Condition examples
Object == null (check to be an object is null)
this.Log.IsTrue(lAppAnlageKenForm != null, "Object AnageKenForm", "is null");
this.Log.IsTrue((lResultCorrect == lResult),
"Check result",
"The result should be " + lResultCorrect.ToString(),
"The result is correct");
See Also Reference
Log.HasFailed
Log.ResultMessage