TestCacheDelegatingHandlerBase

Base class for implementation of TestCache handlers for unit testing.

Syntax

public class TestCacheDelegatingHandlerBase : DelegatingHandler, IDisposable

Inheritance

Implements

Constructors

TestCacheDelegatingHandlerBase

public TestCacheDelegatingHandlerBase(string responseFilesPath)
Constructor overload for specifying the root folder path.

Parameters

  • responseFilesPath string: Root folder path for storing static response files.

Properties

ResponseFilesPath

public string ResponseFilesPath { get; }
Stores the root folder for reading/writing static response files.

Returns

string

Methods

GetFileExtensionString

public static string GetFileExtensionString(HttpRequestMessage request)
Maps the MediaType header in the to a known list of file extensions.

Parameters

Returns

string

GetResponseMediaTypeString

public static string GetResponseMediaTypeString(string filePath)
Maps the file extension in the specified path to a known list of media types.

Parameters

Returns

string