C# Class FluentRest.Fake.FileMessageStore

A file based fake message store. The fake response messages are saved and loaded from the StorePath directory.
Inheritance: FluentRest.Fake.FakeMessageStore
ファイルを表示 Open project: loresoft/FluentRest Class Usage Examples

Public Methods

Method Description
GenerateHash ( string text ) : string

Generates a hash for the specified text.

LoadAsync ( HttpRequestMessage request ) : Task

Loads an HTTP fake response message for the specified HTTP request as an asynchronous operation.

SaveAsync ( HttpRequestMessage request, HttpResponseMessage response ) : Task

Saves the specified HTTP response to the message store as an asynchronous operation.

Private Methods

Method Description
GetPaths ( HttpRequestMessage request, string &responsePath, string &contentPath ) : void
LoadContent ( string contentPath ) : HttpContent
LoadResponse ( HttpContent httpContent, string responsePath ) : Task
SaveContent ( HttpResponseMessage response, string contentPath ) : Task
SaveResponse ( HttpResponseMessage response, string responsePath ) : Task

Method Details

GenerateHash() public static method

Generates a hash for the specified text.
public static GenerateHash ( string text ) : string
text string The value to hash.
return string

LoadAsync() public method

Loads an HTTP fake response message for the specified HTTP request as an asynchronous operation.
public LoadAsync ( HttpRequestMessage request ) : Task
request System.Net.Http.HttpRequestMessage The HTTP request message to load response for.
return Task

SaveAsync() public method

Saves the specified HTTP response to the message store as an asynchronous operation.
public SaveAsync ( HttpRequestMessage request, HttpResponseMessage response ) : Task
request HttpRequestMessage The HTTP request message that was sent.
response HttpResponseMessage The HTTP response messsage to save.
return Task