C# Класс Castle.MonoRail.Framework.Test.MockViewEngine

Represents a mock implementation of IViewEngine for unit test purposes.
Наследование: IViewEngine
Показать файл Открыть проект

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

Метод Описание
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.

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

CreateJSGenerator() публичный Метод

Implementors should return a generator instance if the view engine supports JS generation.
public CreateJSGenerator ( IRailsEngineContext context ) : object
context IRailsEngineContext The request context.
Результат object

GenerateJS() публичный Метод

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.
Результат void

GenerateJS() публичный Метод

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.
Результат void

HasTemplate() публичный Метод

Evaluates whether the specified template exists.
public HasTemplate ( string templateName ) : bool
templateName string
Результат bool

MockViewEngine() публичный Метод

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].
Результат System

Process() публичный Метод

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
Результат void

Process() публичный Метод

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
Результат void

ProcessContents() публичный Метод

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
Результат void

ProcessPartial() публичный Метод

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.
Результат void