C# Class Ploeh.AutoFixture.AutoFakeItEasy2.FakeItEasyBuilder

Inheritance: ISpecimenBuilder
Afficher le fichier Open project: AutoFixture/AutoFixture

Méthodes publiques

Méthode Description
Create ( object request, ISpecimenContext context ) : object

Creates a new specimen based on a request.

The Create method checks whether a request is for an interface or abstract class. If so it delegates the call to the decorated Builder. When the specimen is returned from the decorated ISpecimenBuilder the method checks whether the returned instance is a FakeItEasy Fake instance of the correct type.

If all pre- and post-conditions are satisfied, the mock instance is returned; otherwise a NoSpecimen instance.

FakeItEasyBuilder ( ISpecimenBuilder builder ) : System

Initializes a new instance of the FakeItEasyBuilder class with an ISpecimenBuilder to decorate.

builder is subsequently available through the Builder property.

Method Details

Create() public méthode

Creates a new specimen based on a request.

The Create method checks whether a request is for an interface or abstract class. If so it delegates the call to the decorated Builder. When the specimen is returned from the decorated ISpecimenBuilder the method checks whether the returned instance is a FakeItEasy Fake instance of the correct type.

If all pre- and post-conditions are satisfied, the mock instance is returned; otherwise a NoSpecimen instance.

public Create ( object request, ISpecimenContext context ) : object
request object The request that describes what to create.
context ISpecimenContext A context that can be used to create other specimens.
Résultat object

FakeItEasyBuilder() public méthode

Initializes a new instance of the FakeItEasyBuilder class with an ISpecimenBuilder to decorate.

builder is subsequently available through the Builder property.

public FakeItEasyBuilder ( ISpecimenBuilder builder ) : System
builder ISpecimenBuilder The builder which must build mock instances.
Résultat System