C# Класс !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.
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
scope Castle.ActiveRecord.SessionScope

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

Метод Описание
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

Приватные методы

Метод Описание
FixtureInit ( ) : void
Init ( ) : void
Terminate ( ) : void
TerminateAll ( ) : void

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

CreateScope() защищенный метод

protected CreateScope ( ) : void
Результат void

DisposeScope() защищенный метод

protected DisposeScope ( ) : void
Результат void

DropSchema() защищенный метод

protected DropSchema ( ) : void
Результат void

FlushAndRecreateScope() защищенный метод

protected FlushAndRecreateScope ( ) : void
Результат void

InitFramework() защищенный метод

protected InitFramework ( ) : void
Результат void

PrepareSchema() защищенный метод

If you want to delete everything from the model. Remember to do it in a descendent dependency order
protected PrepareSchema ( ) : void
Результат void

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

scope защищенное свойство

protected SessionScope,Castle.ActiveRecord scope
Результат Castle.ActiveRecord.SessionScope