CSLA 3.8.2 Tests

CSLA 3.8.2 Tests

Old forum URL: forums.lhotka.net/forums/t/8634.aspx


Smith866 posted on Tuesday, March 09, 2010

I was wondering if anybody else was having issues getting all of the unit tests for CSLA 3.8.2 to pass?  I am able to get all of the 3.8.1 tests to pass, but the following 2 tests always fail in 3.8.2 (and 3.8.3 beta):

Csla.Test.Data.ContextTests.Using_TransactionManager_Insert_2records_increases_count_by2_then_removing_them_decreases_count_by2:
Csla.DataPortalException : DataPortal.Update failed (System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
   at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Rollback()
   at Csla.Data.TransactionManager`2.DeRef() in C:\Code\cslacs-3.8.2-100201\cslacs\Csla\Data\TransactionManager.cs:line 211
   at Csla.Data.TransactionManager`2.Dispose() in C:\Code\cslacs-3.8.2-100201\cslacs\Csla\Data\TransactionManager.cs:line 232
   at Csla.Test.Data.TransactionContextUserList.DataPortal_Update() in C:\Code\cslacs-3.8.2-100201\cslatest\Csla.Test\Data\TransactionContextUserList.cs:line 59
   at dm(Object , Object[] )
   at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Code\cslacs-3.8.2-100201\cslacs\Csla\Reflection\MethodCaller.cs:line 357)
  ----> Csla.Reflection.CallMethodException : DataPortal_Update method call failed
  ----> System.InvalidOperationException : This SqlTransaction has completed; it is no longer usable.

 

AND

 

Csla.Test.Data.ContextTests.Using_TransactionManager_Insert_of_2records_rolls_back_if_second_record_fails_insert:
  Transaction context should have been null
  Expected: 0
  But was:  1

I am using SQL Server 2008 SP1.  I have tried moving between Express and Developer editions, with the same result from either.

I apologize if I have missed something obvious, I am new to CSLA.

RockfordLhotka replied on Tuesday, March 09, 2010

There's clearly a problem with those tests, I agree. I don't know that I'll trace down the issue in 3.8 anymore, but the problem is there in 4 as well, and will certainly be addressed.

I strongly suspect the tests are broken. A change was made to TransactionManager in 3.8.2, and I think the tests were not updated accordingly.

Copyright (c) Marimer LLC