PeanutButter
Loading...
Searching...
No Matches
PeanutButter.RandomGenerators.RandomizerAttribute Class Referenceabstract

Base class to use when wishing to guide randomization on a builder via attributes. More...

Inheritance diagram for PeanutButter.RandomGenerators.RandomizerAttribute:
PeanutButter.RandomGenerators.NoRandomize PeanutButter.RandomGenerators.RequireNonZero PeanutButter.RandomGenerators.RequireUnique PeanutButter.RandomGenerators.Restrict PeanutButter.RandomGenerators.RequireNonZeroId PeanutButter.RandomGenerators.RequireUnique< T > PeanutButter.RandomGenerators.RequireUniqueId

Public Member Functions

void SetRandomValue (PropertyOrField propInfo, ref object target)
 Actually invoked when attempting to set a random value on the named property.
virtual void Init (Type type)
 override in your implementation if you'd like to late-initialize relevant property names

Protected Member Functions

 RandomizerAttribute (string propertyName, params string[] otherPropertyNames)
 Constructs this attribute to act against one or more properties by name.

Properties

string[] PropertyNames [get]
 The name of the property to which this randomizer attribute pertains.

Detailed Description

Base class to use when wishing to guide randomization on a builder via attributes.

Constructor & Destructor Documentation

◆ RandomizerAttribute()

PeanutButter.RandomGenerators.RandomizerAttribute.RandomizerAttribute ( string propertyName,
params string[] otherPropertyNames )
protected

Constructs this attribute to act against one or more properties by name.

Parameters
propertyNameinitial property name
otherPropertyNamesany additional property names

Member Function Documentation

◆ Init()

virtual void PeanutButter.RandomGenerators.RandomizerAttribute.Init ( Type type)
virtual

override in your implementation if you'd like to late-initialize relevant property names

Parameters
type

Reimplemented in PeanutButter.RandomGenerators.RequireUnique, and PeanutButter.RandomGenerators.RequireUniqueId.

◆ SetRandomValue()

void PeanutButter.RandomGenerators.RandomizerAttribute.SetRandomValue ( PropertyOrField propInfo,
ref object target )
abstract

Actually invoked when attempting to set a random value on the named property.

Parameters
propInfo
target

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.RandomGenerators/RandomizerAttribute.cs