C# 클래스 Ploeh.AutoFixture.AutoFakeItEasy.FakeItEasyBuilder

Provides pre- and post-condition checks for requests for fake instances.
상속: ISpecimenBuilder
파일 보기 프로젝트 열기: AutoFixture/AutoFixture

공개 메소드들

메소드 설명
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.

메소드 상세

Create() 공개 메소드

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.
리턴 object

FakeItEasyBuilder() 공개 메소드

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.
리턴 System