Boolean Extensions - adyle5/ExtensionsDotNet GitHub Wiki

TryParseExt

Description
Maps to Boolean.TryParse

Parameters
input (string)

Usage

string input = "true";
bool output = false;
output.TryParseExt(input);

Will result in output equal to true


ParseExt

Description
Maps to Boolean.Parse

Parameters
input (string)

Usage

string input = "true";
bool output = false;
output.ParseExt(input);

Will result in output equal to true


EqualsExt

Description
Maps to Boolean.Equals

Parameters
input (bool)

Usage

bool input = false;
bool output = false;
bool areEqual = output.EqualsExt(input);

Will result in areEqual equal to true


AssertExt

Description
If extended object's condition is false, will output a message to the trace listener.
Maps to Trace.Assert

Parameters
None

Usage

bool condition = 2 > 3;
condition.AssertExt();

Will output:
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----

---- Assert Long Message ----


AssertExt (w/short message)

Description
If extended object's condition is false, will output provided message to the trace listener.
Maps to Trace.Assert

Parameters
shortMessage (string)

Usage

bool condition = 2 > 3;
string msg = "short message";
condition.AssertExt(msg);

Will output:
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
short message
---- Assert Long Message ----


AssertExt (w/detailed message)

Description
If extended object's condition is false, will output provided short and detailed messages to the trace listener.
Maps to Trace.Assert

Parameters
shortMessage (string) detailedMessage (string)

Usage

bool condition = 2 > 3;
string msg = "short message";
string details = "detailed message";
condition.AssertExt(msg, details);

Will output:
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
short message
---- Assert Long Message ----
detailed message