C# Class Microsoft.Protocols.TestSuites.Pchc.PchcClientAdapter

PCHC adapter implementation to test client behaviors.
Inheritance: Microsoft.Protocols.TestTools.ManagedAdapterBase, IPchcClientAdapter
Show file Open project: Microsoft/WindowsProtocolTestSuites

Public Methods

Method Description
ExpectInitialOfferMessage ( System.TimeSpan timeout ) : InitialOfferMessage

Receive a InitialOfferMessage from the Client.

ExpectSegmentInfoMessage ( System.TimeSpan timeout ) : SegmentInfoMessage

Receive a SegmentInfoMessage from the Client.

Initialize ( ITestSite testSite ) : void

Initialize protocol adapter.

Reset ( ) : void

Reset the adapter

SendHttpStatusCode401 ( ) : void

Send the Http Status Code 401.

SendResponseMessage ( int responseCode ) : void

Send the corresponding response for the request message.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

Private Methods

Method Description
GetProperty ( string propName ) : string

Get the value of property in ptfconfig file.

ValidateClientInitialization ( string serverComputerName, string httpsPort, string transProtocol ) : void

Validate client initialization RS.

ValidateConnectionInformation ( CONNECTION_INFORMATION connectInfo ) : void

Validate the CONNECTION_INFORMATION of request message.

ValidateInitialOfferMessage ( INITIAL_OFFER_MESSAGE initialOfferMsg ) : void

Capture the INITIAL_OFFER_MESSAGE message RS

ValidatePccrcCSegment ( Content_Information_Data_Structure segmentInformation, int hashLength ) : void

Validate pccrc cSegments part.

ValidatePccrcSegmentInfoVersion ( Content_Information_Data_Structure segmentInformation, int valueOfDwHashAlgo, int hashLength ) : void

Validate pccrc segment info version part.

ValidateRequestMessageHeader ( MESSAGE_HEADER messageHeader ) : void

Validate the MESSAGE_HEADER of request message.

ValidateSegmentInfoMessage ( SEGMENT_INFO_MESSAGE segmentInfoMsg, string platformOsVersion ) : void

Capture SEGMENT_INFO_MESSAGE message RS

ValidateSegmentInformation ( Content_Information_Data_Structure segmentInformation ) : void

Validate the SegmentInformation in the Segment_info-Message.

ValidateSegmentInformationFromPccrc ( Content_Information_Data_Structure segmentInformation ) : void

Validate the segmentInformation In SEGMTNE_INFO_MESSAGE.

ValidateTransport ( string method ) : void

Validate the transport between the client and the hosted cahce.

Method Details

Dispose() protected method

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals false, the method has been called by the /// runtime from inside the finalizer and you should not reference /// other objects. Only unmanaged resources can be disposed.
return void

ExpectInitialOfferMessage() public method

Receive a InitialOfferMessage from the Client.
public ExpectInitialOfferMessage ( System.TimeSpan timeout ) : InitialOfferMessage
timeout System.TimeSpan Waiting for specified timeout to receive the specified request.
return InitialOfferMessage

ExpectSegmentInfoMessage() public method

Receive a SegmentInfoMessage from the Client.
public ExpectSegmentInfoMessage ( System.TimeSpan timeout ) : SegmentInfoMessage
timeout System.TimeSpan Waiting for specified timeout to receive the specified request.
return SegmentInfoMessage

Initialize() public method

Initialize protocol adapter.
public Initialize ( ITestSite testSite ) : void
testSite ITestSite The test site.
return void

Reset() public method

Reset the adapter
public Reset ( ) : void
return void

SendHttpStatusCode401() public method

Send the Http Status Code 401.
public SendHttpStatusCode401 ( ) : void
return void

SendResponseMessage() public method

Send the corresponding response for the request message.
public SendResponseMessage ( int responseCode ) : void
responseCode int /// The ResponseCode specified the hosted cache server is INTERESTED or OK. /// 1 is for INTERESTED, 0 is for OK. ///
return void