C# Class Castle.MonoRail.Framework.Test.MockViewEngine

Represents a mock implementation of IViewEngine for unit test purposes.
Inheritance: IViewEngine
Afficher le fichier Open project: nats/castle-1.0.3-mono

Méthodes publiques

Méthode Description
CreateJSGenerator ( IRailsEngineContext context ) : object

Implementors should return a generator instance if the view engine supports JS generation.

GenerateJS ( IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the js generation view template - using the templateName to obtain the correct template, and using the context to output the result.

GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the js generation view template - using the templateName to obtain the correct template, and using the specified TextWriter to output the result.

HasTemplate ( string templateName ) : bool

Evaluates whether the specified template exists.

MockViewEngine ( string viewFileExtension, string jsGeneratorFileExtension, bool supportsJSGeneration, bool xHtmlRendering ) : System

Initializes a new instance of the MockViewEngine class.

Process ( IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the view - using the templateName to obtain the correct template, and using the context to output the result.

Process ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void

Processes the view - using the templateName to obtain the correct template and writes the results to the TextWriter. No layout is applied!

ProcessContents ( IRailsEngineContext context, Controller controller, string contents ) : void

Wraps the specified content in the layout using the context to output the result.

ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void

Should process the specified partial. The partial name must contains the path relative to the views folder.

Method Details

CreateJSGenerator() public méthode

Implementors should return a generator instance if the view engine supports JS generation.
public CreateJSGenerator ( IRailsEngineContext context ) : object
context IRailsEngineContext The request context.
Résultat object

GenerateJS() public méthode

Processes the js generation view template - using the templateName to obtain the correct template, and using the context to output the result.
public GenerateJS ( IRailsEngineContext context, Controller controller, string templateName ) : void
context IRailsEngineContext The request context.
controller Controller The controller.
templateName string Name of the template.
Résultat void

GenerateJS() public méthode

Processes the js generation view template - using the templateName to obtain the correct template, and using the specified TextWriter to output the result.
public GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void
output System.IO.TextWriter The output.
context IRailsEngineContext The request context.
controller Controller The controller.
templateName string Name of the template.
Résultat void

HasTemplate() public méthode

Evaluates whether the specified template exists.
public HasTemplate ( string templateName ) : bool
templateName string
Résultat bool

MockViewEngine() public méthode

Initializes a new instance of the MockViewEngine class.
public MockViewEngine ( string viewFileExtension, string jsGeneratorFileExtension, bool supportsJSGeneration, bool xHtmlRendering ) : System
viewFileExtension string The view file extension.
jsGeneratorFileExtension string The js generator file extension.
supportsJSGeneration bool if set to true [supports JS generation].
xHtmlRendering bool if set to true [x HTML rendering].
Résultat System

Process() public méthode

Processes the view - using the templateName to obtain the correct template, and using the context to output the result.
public Process ( IRailsEngineContext context, Controller controller, string templateName ) : void
context IRailsEngineContext
controller Controller
templateName string
Résultat void

Process() public méthode

Processes the view - using the templateName to obtain the correct template and writes the results to the TextWriter. No layout is applied!
public Process ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void
output System.IO.TextWriter
context IRailsEngineContext
controller Controller
templateName string
Résultat void

ProcessContents() public méthode

Wraps the specified content in the layout using the context to output the result.
public ProcessContents ( IRailsEngineContext context, Controller controller, string contents ) : void
context IRailsEngineContext The request context.
controller Controller The controller.
contents string Content to output
Résultat void

ProcessPartial() public méthode

Should process the specified partial. The partial name must contains the path relative to the views folder.
public ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void
output System.IO.TextWriter The output.
context IRailsEngineContext The request context.
controller Controller The controller.
partialName string The partial name.
Résultat void