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

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

Открытые свойства

Свойство Тип Описание
OnBodyRender TestSectionRender
OnViewRender TestViewRender

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

Метод Описание
HasSection ( string sectionName ) : bool

Determines whether the current component declaration on the view has the specified section.

MockViewComponentContext ( string componentName, TextWriter writer, IViewEngine viewEngine ) : System

Initializes a new instance of the MockViewComponentContext class.

RenderBody ( ) : void

Renders the component body.

RenderBody ( TextWriter writer ) : void

Renders the body into the specified TextWriter

RenderSection ( string sectionName ) : void

Renders the the specified section. No exception will the throw if the section cannot be found.

RenderSection ( string sectionName, TextWriter writer ) : void

Renders the the specified section. No exception will the throw if the section cannot be found.

RenderView ( string name, TextWriter writer ) : void

Renders the view specified to the writer.

Защищенные методы

Метод Описание
MockViewComponentContext ( ) : System

Initializes a new instance of the MockViewComponentContext class.

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

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

Determines whether the current component declaration on the view has the specified section.
public HasSection ( string sectionName ) : bool
sectionName string Name of the section.
Результат bool

MockViewComponentContext() защищенный Метод

Initializes a new instance of the MockViewComponentContext class.
protected MockViewComponentContext ( ) : System
Результат System

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

Initializes a new instance of the MockViewComponentContext class.
public MockViewComponentContext ( string componentName, TextWriter writer, IViewEngine viewEngine ) : System
componentName string Name of the component.
writer System.IO.TextWriter The writer.
viewEngine IViewEngine The view engine.
Результат System

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

Renders the component body.
public RenderBody ( ) : void
Результат void

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

Renders the body into the specified TextWriter
public RenderBody ( TextWriter writer ) : void
writer System.IO.TextWriter The writer.
Результат void

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

Renders the the specified section. No exception will the throw if the section cannot be found.
public RenderSection ( string sectionName ) : void
sectionName string Name of the section.
Результат void

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

Renders the the specified section. No exception will the throw if the section cannot be found.
public RenderSection ( string sectionName, TextWriter writer ) : void
sectionName string Name of the section.
writer System.IO.TextWriter The writer to output the section content.
Результат void

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

Renders the view specified to the writer.
public RenderView ( string name, TextWriter writer ) : void
name string The view template name
writer System.IO.TextWriter A writer to output
Результат void

Описание свойств

OnBodyRender публичное свойство

Event that is raised when a section is rendered by the viewcomponent.
public TestSectionRender OnBodyRender
Результат TestSectionRender

OnViewRender публичное свойство

Event that is raised when a view is rendered by the viewcomponent.
public TestViewRender OnViewRender
Результат TestViewRender