C# Class !NAMESPACE!.Tests.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 FlushAndRecreateScope sometimes to persist the changes.
Afficher le fichier Open project: nats/castle-1.0.3-mono

Protected Properties

Свойство Type Description
scope Castle.ActiveRecord.SessionScope

Méthodes protégées

Méthode Description
CreateScope ( ) : void
DisposeScope ( ) : void
DropSchema ( ) : void
FlushAndRecreateScope ( ) : 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

Méthode Description
FixtureInit ( ) : void
Init ( ) : void
Terminate ( ) : void
TerminateAll ( ) : void

Method Details

CreateScope() protected méthode

protected CreateScope ( ) : void
Résultat void

DisposeScope() protected méthode

protected DisposeScope ( ) : void
Résultat void

DropSchema() protected méthode

protected DropSchema ( ) : void
Résultat void

FlushAndRecreateScope() protected méthode

protected FlushAndRecreateScope ( ) : void
Résultat void

InitFramework() protected méthode

protected InitFramework ( ) : void
Résultat void

PrepareSchema() protected méthode

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

Property Details

scope protected_oe property

protected SessionScope,Castle.ActiveRecord scope
Résultat Castle.ActiveRecord.SessionScope