C# Class Sage.Test.Mother

Mocks various MVC and HTTP objects.
Afficher le fichier Open project: igorfrance/sage

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

CreateHttpContext() public static méthode

public static CreateHttpContext ( string url ) : System.Web.HttpContextBase
url string
Résultat System.Web.HttpContextBase

CreateHttpContext() public static méthode

public static CreateHttpContext ( string url, string physicalPath ) : System.Web.HttpContextBase
url string
physicalPath string
Résultat System.Web.HttpContextBase

CreateHttpRequest() public static méthode

Creates a new fake HTTP request with its url and physicalPath properties set to null.
public static CreateHttpRequest ( ) : System.Web.HttpRequestBase
Résultat System.Web.HttpRequestBase

CreateHttpRequest() public static méthode

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.
Résultat System.Web.HttpRequestBase

CreateMockController() public static méthode

public static CreateMockController ( ) : SageController
Résultat Sage.Controllers.SageController

CreateRequestContext() public static méthode

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.
Résultat System.Web.Routing.RequestContext

CreateRequestContext() public static méthode

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.
Résultat System.Web.Routing.RequestContext

CreateRequestContext() public static méthode

Creates a new request context, using the specified request url.
public static CreateRequestContext ( string url ) : System.Web.Routing.RequestContext
url string The URL.
Résultat System.Web.Routing.RequestContext

CreateRequestContext() public static méthode

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.
Résultat System.Web.Routing.RequestContext

CreateSageContext() public static méthode

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.
Résultat SageContext

CreateSageContext() public static méthode

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.
Résultat SageContext

CreateSageContext() public static méthode

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.
Résultat SageContext

CreateSageContext() public static méthode

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.
Résultat SageContext

CreateSageContext() public static méthode

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.
Résultat SageContext

CreateUri() public static méthode

public static CreateUri ( string url ) : Uri
url string
Résultat System.Uri

SetHttpMethodResult() public static méthode

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.
Résultat void

SetupRequestUrl() public static méthode

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.
Résultat void