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

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

Public Methods

Method 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 method

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

GenerateJS() public method

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.
return void

GenerateJS() public method

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.
return void

HasTemplate() public method

Evaluates whether the specified template exists.
public HasTemplate ( string templateName ) : bool
templateName string
return bool

MockViewEngine() public method

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].
return System

Process() public method

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
return void

Process() public method

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
return void

ProcessContents() public method

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
return void

ProcessPartial() public method

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.
return void