PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.Logic Class Reference

Allows you to rewrite, eg: var foo = o.Prop1 == 1 && o.Prop2 == 2 && o.Prop3 == 3 ... as AllOf( o.Prop1 == 1, o.Prop2 == 2, o.Prop3 == 3 ) (which is easier to read & manipulate, eg in a test, especially if you import with using static) More...

Static Public Member Functions

static bool AllOf (bool flag1, bool flag2, params bool[] moreFlags)
 Returns the result of and'ing all booleans together.
 
static bool AllOf (Func< bool > generator1, Func< bool > generator2, params Func< bool >[] moreGenerators)
 Returns the result of and'ing all booleans (lazy eval) together.
 
static bool AnyOf (bool flag1, bool flag2, params bool[] moreFlags)
 Returns the result of or'ing all booleans together.
 
static bool AnyOf (Func< bool > generator1, Func< bool > generator2, params Func< bool >[] moreGenerators)
 Returns the result of or'ing all booleans (lazy eval) together.
 
static bool NoneOf (bool flag1, bool flag2, params bool[] moreFlags)
 Returns true when none of the inputs are true.
 
static bool NoneOf (Func< bool > generator1, Func< bool > generator2, params Func< bool >[] moreGenerators)
 Returns true when none of the inputs are true (lazy eval)
 

Detailed Description

Allows you to rewrite, eg: var foo = o.Prop1 == 1 && o.Prop2 == 2 && o.Prop3 == 3 ... as AllOf( o.Prop1 == 1, o.Prop2 == 2, o.Prop3 == 3 ) (which is easier to read & manipulate, eg in a test, especially if you import with using static)

Member Function Documentation

◆ AllOf() [1/2]

static bool PeanutButter.Utils.Logic.AllOf ( bool  flag1,
bool  flag2,
params bool[]  moreFlags 
)
static

Returns the result of and'ing all booleans together.

Parameters
flag1
flag2
moreFlags
Returns

◆ AllOf() [2/2]

static bool PeanutButter.Utils.Logic.AllOf ( Func< bool >  generator1,
Func< bool >  generator2,
params Func< bool >[]  moreGenerators 
)
static

Returns the result of and'ing all booleans (lazy eval) together.

Parameters
generator1
generator2
moreGenerators
Returns

◆ AnyOf() [1/2]

static bool PeanutButter.Utils.Logic.AnyOf ( bool  flag1,
bool  flag2,
params bool[]  moreFlags 
)
static

Returns the result of or'ing all booleans together.

Parameters
flag1
flag2
moreFlags
Returns

◆ AnyOf() [2/2]

static bool PeanutButter.Utils.Logic.AnyOf ( Func< bool >  generator1,
Func< bool >  generator2,
params Func< bool >[]  moreGenerators 
)
static

Returns the result of or'ing all booleans (lazy eval) together.

Parameters
generator1
generator2
moreGenerators
Returns

◆ NoneOf() [1/2]

static bool PeanutButter.Utils.Logic.NoneOf ( bool  flag1,
bool  flag2,
params bool[]  moreFlags 
)
static

Returns true when none of the inputs are true.

Parameters
flag1
flag2
moreFlags
Returns

◆ NoneOf() [2/2]

static bool PeanutButter.Utils.Logic.NoneOf ( Func< bool >  generator1,
Func< bool >  generator2,
params Func< bool >[]  moreGenerators 
)
static

Returns true when none of the inputs are true (lazy eval)

Parameters
generator1
generator2
moreGenerators
Returns

The documentation for this class was generated from the following file: