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

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

Méthodes publiques

Свойство Type Description
OnBodyRender TestSectionRender
OnViewRender TestViewRender

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
MockViewComponentContext ( ) : System

Initializes a new instance of the MockViewComponentContext class.

Method Details

HasSection() public méthode

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

MockViewComponentContext() protected méthode

Initializes a new instance of the MockViewComponentContext class.
protected MockViewComponentContext ( ) : System
Résultat System

MockViewComponentContext() public méthode

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.
Résultat System

RenderBody() public méthode

Renders the component body.
public RenderBody ( ) : void
Résultat void

RenderBody() public méthode

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

RenderSection() public méthode

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.
Résultat void

RenderSection() public méthode

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.
Résultat void

RenderView() public méthode

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
Résultat void

Property Details

OnBodyRender public_oe property

Event that is raised when a section is rendered by the viewcomponent.
public TestSectionRender OnBodyRender
Résultat TestSectionRender

OnViewRender public_oe property

Event that is raised when a view is rendered by the viewcomponent.
public TestViewRender OnViewRender
Résultat TestViewRender