C# Class !NAMESPACE!.AbstractModelTestCase

This is a suggestion of base class that might simplify the unit testing for the ActiveRecord classes.

Basically you have to create a separate database for your tests, which is always a good idea: - production - development - test

You have to decide if you want to administrate the schema on the test database or let ActiveRecord generate them for you during test execution. Check AbstractModelTestCase.PrepareSchema

Note that this class enables lazy classes and collections by using a SessionScope. This have side effects. Some of your test must invoke Flush to persist the changes.
Datei anzeigen Open project: nats/castle-1.0.3-mono

Protected Properties

Property Type Description
scope Castle.ActiveRecord.SessionScope

Protected Methods

Method Description
CreateScope ( ) : void
DisposeScope ( ) : void
DropSchema ( ) : void
Flush ( ) : void
InitFramework ( ) : void
PrepareSchema ( ) : void

If you want to delete everything from the model. Remember to do it in a descendent dependency order

Private Methods

Method Description
FixtureInit ( ) : void
Init ( ) : void
Terminate ( ) : void
TerminateAll ( ) : void

Method Details

CreateScope() protected method

protected CreateScope ( ) : void
return void

DisposeScope() protected method

protected DisposeScope ( ) : void
return void

DropSchema() protected method

protected DropSchema ( ) : void
return void

Flush() protected method

protected Flush ( ) : void
return void

InitFramework() protected method

protected InitFramework ( ) : void
return void

PrepareSchema() protected method

If you want to delete everything from the model. Remember to do it in a descendent dependency order
protected PrepareSchema ( ) : void
return void

Property Details

scope protected_oe property

protected SessionScope,Castle.ActiveRecord scope
return Castle.ActiveRecord.SessionScope