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

Represents a mock implementation of IMockViewComponentContext for unit test purposes.
Inheritance: IMockViewComponentContext
Exibir arquivo Open project: nats/castle-1.0.3-mono Class Usage Examples

Public Properties

Property Type Description
OnBodyRender TestSectionRender
OnViewRender TestViewRender

Public Methods

Method Description
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.

Protected Methods

Method Description
MockViewComponentContext ( ) : System

Initializes a new instance of the MockViewComponentContext class.

Method Details

HasSection() public method

Determines whether the current component declaration on the view has the specified section.
public HasSection ( string sectionName ) : bool
sectionName string Name of the section.
return bool

MockViewComponentContext() protected method

Initializes a new instance of the MockViewComponentContext class.
protected MockViewComponentContext ( ) : System
return System

MockViewComponentContext() public method

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

RenderBody() public method

Renders the component body.
public RenderBody ( ) : void
return void

RenderBody() public method

Renders the body into the specified TextWriter
public RenderBody ( TextWriter writer ) : void
writer System.IO.TextWriter The writer.
return void

RenderSection() public method

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

RenderSection() public method

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

RenderView() public method

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

Property Details

OnBodyRender public_oe property

Event that is raised when a section is rendered by the viewcomponent.
public TestSectionRender OnBodyRender
return TestSectionRender

OnViewRender public_oe property

Event that is raised when a view is rendered by the viewcomponent.
public TestViewRender OnViewRender
return TestViewRender