C# Class MbDotNet.MountebankClient

Inheritance: IClient
Show file Open project: mattherman/MbDotNet

Public Methods

Method Description
CreateHttpImposter ( int port, string name = null ) : HttpImposter

Creates a new imposter on the specified port with the HTTP protocol. The Submit method must be called on the client in order to submit the imposter to mountebank.

CreateTcpImposter ( int port, string name = null, TcpMode mode = TcpMode.Text ) : TcpImposter

Creates a new imposter on the specified port with the TCP protocol. The Submit method must be called on the client in order to submit the imposter to mountebank.

DeleteAllImposters ( ) : void

Deletes all imposters from mountebank. Will also remove the imposter from the collection of imposters that the client maintains.

DeleteImposter ( int port ) : void

Deletes a single imposter from mountebank. Will also remove the imposter from the collection of imposters that the client maintains.

GetImposter ( int port ) : RetrievedImposter
MountebankClient ( ) : System.Collections.Generic
MountebankClient ( string mountebankUrl ) : System.Collections.Generic
Submit ( ICollection imposters ) : void

Submits all pending imposters from the supplied collection to be created in mountebank. Will throw a MountebankException if unable to create the imposter for any reason.

Submit ( Imposter imposter ) : void

Submits imposter if pending to be created in mountebank. Will throw a MountebankException if unable to create the imposter for any reason.

Private Methods

Method Description
MountebankClient ( IRequestProxy requestProxy ) : System.Collections.Generic

Method Details

CreateHttpImposter() public method

Creates a new imposter on the specified port with the HTTP protocol. The Submit method must be called on the client in order to submit the imposter to mountebank.
public CreateHttpImposter ( int port, string name = null ) : HttpImposter
port int The port the imposter will be set up to receive requests on
name string The name the imposter will recieve, useful for debugging/logging purposes
return MbDotNet.Models.Imposters.HttpImposter

CreateTcpImposter() public method

Creates a new imposter on the specified port with the TCP protocol. The Submit method must be called on the client in order to submit the imposter to mountebank.
public CreateTcpImposter ( int port, string name = null, TcpMode mode = TcpMode.Text ) : TcpImposter
port int The port the imposter will be set up to receive requests on
name string The name the imposter will recieve, useful for debugging/logging purposes
mode TcpMode The mode of the imposter, text or binary. This defines the encoding for request/response data
return MbDotNet.Models.Imposters.TcpImposter

DeleteAllImposters() public method

Deletes all imposters from mountebank. Will also remove the imposter from the collection of imposters that the client maintains.
public DeleteAllImposters ( ) : void
return void

DeleteImposter() public method

Deletes a single imposter from mountebank. Will also remove the imposter from the collection of imposters that the client maintains.
public DeleteImposter ( int port ) : void
port int The port number of the imposter to be removed
return void

GetImposter() public method

public GetImposter ( int port ) : RetrievedImposter
port int
return MbDotNet.Models.Imposters.RetrievedImposter

MountebankClient() public method

public MountebankClient ( ) : System.Collections.Generic
return System.Collections.Generic

MountebankClient() public method

public MountebankClient ( string mountebankUrl ) : System.Collections.Generic
mountebankUrl string
return System.Collections.Generic

Submit() public method

Submits all pending imposters from the supplied collection to be created in mountebank. Will throw a MountebankException if unable to create the imposter for any reason.
public Submit ( ICollection imposters ) : void
imposters ICollection
return void

Submit() public method

Submits imposter if pending to be created in mountebank. Will throw a MountebankException if unable to create the imposter for any reason.
public Submit ( Imposter imposter ) : void
imposter MbDotNet.Models.Imposters.Imposter
return void