3.0.1.7 Business object disposability
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
[TestMethod]
|
||||
public void Test_Application_SessionData_Serialization()
|
||||
{
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Internals.
|
||||
SbmcAccountMgr accountMgr = Internals_Control.ControlAccountMgr;
|
||||
@@ -42,7 +42,6 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
|
||||
// User account.
|
||||
SbmcUserAccount userAccount = accountMgr.GetUserAccountByEmailAddress("andy@sarand.com");
|
||||
disposables.Add(userAccount);
|
||||
Assert.IsNotNull(userAccount);
|
||||
|
||||
// Session Context?
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
public void Test_Application_Internals_Control()
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Control internals.
|
||||
Assert.IsNotNull(Internals_Control);
|
||||
@@ -82,11 +82,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
public void Test_Application_CoreInstanceConsole()
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Repository.
|
||||
SbmcRepository repository = GetRandomActiveRepository();
|
||||
disposables.Add(repository);
|
||||
Assert.IsNotNull(repository);
|
||||
|
||||
// Instance console.
|
||||
@@ -101,11 +100,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
public void Test_Application_Internals_Core()
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Repository.
|
||||
SbmcRepository repository = GetRandomActiveRepository();
|
||||
disposables.Add(repository);
|
||||
Assert.IsNotNull(repository);
|
||||
|
||||
// Instance console.
|
||||
@@ -120,11 +118,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
public void Test_Application_SessionContexts()
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
using (DisposableCollection<ISacsDisposable> disposables = new DisposableCollection<ISacsDisposable>())
|
||||
{
|
||||
// Repository.
|
||||
SbmcRepository repository = GetRandomActiveRepository();
|
||||
disposables.Add(repository);
|
||||
Assert.IsNotNull(repository);
|
||||
|
||||
SbmCoreInstanceConsole instanceConsole = new SbmCoreInstanceConsole_Control(SessionData_Control, repository);
|
||||
|
||||
@@ -73,13 +73,8 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App
|
||||
// Core Instance Console.
|
||||
protected SbmCoreInstanceConsole_Control CreateCoreInstanceConsole(String repositoryContext)
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
{
|
||||
SbmcRepository repository = Internals_Control.ControlInstanceMgr.GetRepositoryByContext(repositoryContext);
|
||||
disposables.Add(repository);
|
||||
return new SbmCoreInstanceConsole_Control(SessionData_Control, repository);
|
||||
}
|
||||
SbmcRepository repository = Internals_Control.ControlInstanceMgr.GetRepositoryByContext(repositoryContext);
|
||||
return new SbmCoreInstanceConsole_Control(SessionData_Control, repository);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user