C# Класс Sage.Test.Mother

Mocks various MVC and HTTP objects.
Показать файл Открыть проект

Открытые методы

Метод Описание
CreateHttpContext ( string url ) : System.Web.HttpContextBase
CreateHttpContext ( string url, string physicalPath ) : System.Web.HttpContextBase
CreateHttpRequest ( ) : System.Web.HttpRequestBase

Creates a new fake HTTP request with its url and physicalPath properties set to null.

CreateHttpRequest ( string url, string physicalPath ) : System.Web.HttpRequestBase

Creates a new fake HTTP request with its url and physicalPath properties set to specified values.

CreateMockController ( ) : SageController
CreateRequestContext ( System.Web.HttpContextBase httpContext ) : System.Web.Routing.RequestContext

Creates a new request context.

CreateRequestContext ( System.Web.HttpContextBase httpContext, System.Web.Routing.RouteData routeData ) : System.Web.Routing.RequestContext

Creates a new request context.

CreateRequestContext ( string url ) : System.Web.Routing.RequestContext

Creates a new request context, using the specified request url.

CreateRequestContext ( string category, string locale ) : System.Web.Routing.RequestContext

Creates a new request context, using the specified category and locale.

CreateSageContext ( string url ) : SageContext

Creates a new fake SageContext instance using the specified url.

CreateSageContext ( string url, string>.Func pathMapper ) : SageContext

Creates a new fake SageContext instance.

CreateSageContext ( string category, string locale ) : SageContext

Creates a Sage context using the specified category and locale.

CreateSageContext ( string category, string locale, System.Web.QueryString query ) : SageContext

Creates a Sage context using the specified category, locale and query.

CreateSageContext ( string category, string locale, string query ) : SageContext

Creates a Sage context using the specified category, locale and query.

CreateUri ( string url ) : Uri
SetHttpMethodResult ( this request, string httpMethod ) : void

Sets the HttpRequest.HttpMethod value to the specified string.

SetupRequestUrl ( this request, string url ) : void

Sets the various URL-related properties of the to parts of the specified URL.

Приватные методы

Метод Описание
GetQueryStringParameters ( string url ) : NameValueCollection

Given a URL, returns the just the query string part.

GetUrlFileName ( string url ) : string

Given a URL, returns the name without the query string part.

MapPath ( string path ) : string

Описание методов

CreateHttpContext() публичный статический Метод

public static CreateHttpContext ( string url ) : System.Web.HttpContextBase
url string
Результат System.Web.HttpContextBase

CreateHttpContext() публичный статический Метод

public static CreateHttpContext ( string url, string physicalPath ) : System.Web.HttpContextBase
url string
physicalPath string
Результат System.Web.HttpContextBase

CreateHttpRequest() публичный статический Метод

Creates a new fake HTTP request with its url and physicalPath properties set to null.
public static CreateHttpRequest ( ) : System.Web.HttpRequestBase
Результат System.Web.HttpRequestBase

CreateHttpRequest() публичный статический Метод

Creates a new fake HTTP request with its url and physicalPath properties set to specified values.
public static CreateHttpRequest ( string url, string physicalPath ) : System.Web.HttpRequestBase
url string The URL.
physicalPath string The physical path.
Результат System.Web.HttpRequestBase

CreateMockController() публичный статический Метод

public static CreateMockController ( ) : SageController
Результат Sage.Controllers.SageController

CreateRequestContext() публичный статический Метод

Creates a new request context.
public static CreateRequestContext ( System.Web.HttpContextBase httpContext ) : System.Web.Routing.RequestContext
httpContext System.Web.HttpContextBase The HTTP context to use with the resulting context.
Результат System.Web.Routing.RequestContext

CreateRequestContext() публичный статический Метод

Creates a new request context.
public static CreateRequestContext ( System.Web.HttpContextBase httpContext, System.Web.Routing.RouteData routeData ) : System.Web.Routing.RequestContext
httpContext System.Web.HttpContextBase The HTTP context to use with the resulting context.
routeData System.Web.Routing.RouteData The route data to use with the resulting context.
Результат System.Web.Routing.RequestContext

CreateRequestContext() публичный статический Метод

Creates a new request context, using the specified request url.
public static CreateRequestContext ( string url ) : System.Web.Routing.RequestContext
url string The URL.
Результат System.Web.Routing.RequestContext

CreateRequestContext() публичный статический Метод

Creates a new request context, using the specified category and locale.
public static CreateRequestContext ( string category, string locale ) : System.Web.Routing.RequestContext
category string The category for which to create the fake context.
locale string The locale for which to create the fake context.
Результат System.Web.Routing.RequestContext

CreateSageContext() публичный статический Метод

Creates a new fake SageContext instance using the specified url.
public static CreateSageContext ( string url ) : SageContext
url string The URL to use when creating the new context.
Результат SageContext

CreateSageContext() публичный статический Метод

Creates a new fake SageContext instance.
public static CreateSageContext ( string url, string>.Func pathMapper ) : SageContext
url string The URL to use within the created context.
pathMapper string>.Func The function to use for resolving relative paths.
Результат SageContext

CreateSageContext() публичный статический Метод

Creates a Sage context using the specified category and locale.
public static CreateSageContext ( string category, string locale ) : SageContext
category string The category to set on the context being created.
locale string The locale to set on the context being created.
Результат SageContext

CreateSageContext() публичный статический Метод

Creates a Sage context using the specified category, locale and query.
public static CreateSageContext ( string category, string locale, System.Web.QueryString query ) : SageContext
category string The category to set on the context being created.
locale string The locale to set on the context being created.
query System.Web.QueryString The query string of the fake request to create.
Результат SageContext

CreateSageContext() публичный статический Метод

Creates a Sage context using the specified category, locale and query.
public static CreateSageContext ( string category, string locale, string query ) : SageContext
category string The category to set on the context being created.
locale string The locale to set on the context being created.
query string The query string of the fake request to create.
Результат SageContext

CreateUri() публичный статический Метод

public static CreateUri ( string url ) : Uri
url string
Результат System.Uri

SetHttpMethodResult() публичный статический Метод

Sets the HttpRequest.HttpMethod value to the specified string.
public static SetHttpMethodResult ( this request, string httpMethod ) : void
request this The request to modify.
httpMethod string The HTTP method to set.
Результат void

SetupRequestUrl() публичный статический Метод

Sets the various URL-related properties of the to parts of the specified URL.
If the is null.
public static SetupRequestUrl ( this request, string url ) : void
request this The request to modify.
url string The URL to set.
Результат void