PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder Class Reference

Builds query collections. More...

Inheritance diagram for PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder:
PeanutButter.TestUtils.AspNetCore.Builders.StringMapDerivativeBuilder< TBuilder, TInterface, TConcrete > PeanutButter.TestUtils.AspNetCore.Builders.RandomizableBuilder< TBuilder, TSubject > PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >

Public Member Functions

override QueryCollectionBuilder Randomize ()
QueryCollectionBuilder WithRandomParameters ()
 Establishes some random parameters in the collection.
QueryCollectionBuilder WithParameter< T > (string key, T value)
 Sets a parameter in the collection. Non-string values are allowed for this method, but they will be stringified via interpolation, so make sure that the result of .ToString() is valid on what you're passing in here...
QueryCollectionBuilder WithParameters (IDictionary< string, string > parameters)
 Bulk-sets parameters on the query. Existing parameters will be overwritten.
QueryCollectionBuilder WithParameters (NameValueCollection existingParameters)
 Bulk-sets parameters on the query. Existing parameters will be overwritten.
Public Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.RandomizableBuilder< TBuilder, TSubject >
TBuilder Randomize ()
 Derivatives must implement this so that BuildRandom can work.
Public Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
TBuilder With (Action< TSubject > action)
 Adds a mutator for the artifact.
virtual TSubject Build ()
 Builds the subject artifact.
 Mutator (Action< T > action, string identifier)

Additional Inherited Members

Static Public Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.RandomizableBuilder< TBuilder, TSubject >
static TSubject BuildRandom ()
 Builds a random variant output artifact.
Static Public Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
static TBuilder Create ()
 Returns a new instance of the builder.
static TSubject BuildDefault ()
 Builds the default output artifact.
Protected Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.StringMapDerivativeBuilder< TBuilder, TInterface, TConcrete >
override TInterface ConstructEntity ()
 Override in a derivative builder to provide a custom implementation for TSubject.
Returns
Exceptions
CustomConstructEntityRequired

virtual TBuilder WithRandomItems ()
 adds random items to the collection
virtual TBuilder SetItem< T > (string key, T value)
 Adds an item to the collection - call this by a more specifically-named method on your derivative.
Protected Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
TBuilder With (Action< TSubject > action, string identifier)
 Adds an identified mutator for the artifact - if a mutator with the same identity already exists, it will be removed.
TBuilder With< TCast > (Action< TCast > action)
 Adds a mutator for the artifact, cast to TCast.
TBuilder With< TCast > (Action< TCast > action, string identifier)
 Adds an identified mutator for the artifact, cast to TCast.
TBuilder WithRandomTimes (Action< TSubject > action)
 Applies the given mutator a random (1-4) number of times.
TBuilder WithRandomTimes< TCast > (Action< TCast > action)
 Applies the given mutator on a cast item a random (1-4) number of times.
TBuilder WithPreCursor (Action toRun)
 Run a precursor before your entity is constructed - use when your entity requires constructor parameters you'd like to make user-tweakable via builder methods.
TBuilder WithPostBuild (Action< TSubject > action)
 Add post-build actions.
Static Protected Member Functions inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
static void WarnIf (bool condition, string message)
 Print a traced warning if the condition is found to be false.
static void ErrorIf (bool condition, string message)
 Print a traced warning if the condition is found to be false.
Protected Attributes inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
TSubject CurrentEntity
 During build, CurrentEntity will be set to the currently-building entity. You may implement actualizer(s) in your derivative to pull this value in lazily to consumers.
Properties inherited from PeanutButter.TestUtils.AspNetCore.Builders.Builder< TBuilder, TSubject >
Action< T > Action [get]
string Identifier [get]

Detailed Description

Builds query collections.

Member Function Documentation

◆ WithParameter< T >()

QueryCollectionBuilder PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder.WithParameter< T > ( string key,
T value )

Sets a parameter in the collection. Non-string values are allowed for this method, but they will be stringified via interpolation, so make sure that the result of .ToString() is valid on what you're passing in here...

Parameters
key
value
Template Parameters
T
Returns

◆ WithParameters() [1/2]

QueryCollectionBuilder PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder.WithParameters ( IDictionary< string, string > parameters)

Bulk-sets parameters on the query. Existing parameters will be overwritten.

Parameters
parameters
Returns
Exceptions
ArgumentNullException

◆ WithParameters() [2/2]

QueryCollectionBuilder PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder.WithParameters ( NameValueCollection existingParameters)

Bulk-sets parameters on the query. Existing parameters will be overwritten.

Parameters
existingParameters
Exceptions
NotImplementedException

◆ WithRandomParameters()

QueryCollectionBuilder PeanutButter.TestUtils.AspNetCore.Builders.QueryCollectionBuilder.WithRandomParameters ( )

Establishes some random parameters in the collection.

Returns

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.AspNetCore/Builders/QueryCollectionBuilder.cs