Well, I have crated one solutions for this, it is very simple fixture
for each method.
Well this one don't rollback using database backup but atleast rollback
each transaction.
I hope this get you started.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''code for fixture
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Imports System.ComponentModel
Imports MbUnit.Core.Framework
Imports MbUnit.Core.Invokers
Namespace MbUnitHelper
<AttributeUsage(AttributeTargets.Method, AllowMultiple:=False,
Inherited:=True)> _
Public Class UseTransactinScopeForRollbackAttribute
Inherits DecoratorPatternAttribute
Public Overrides Function GetInvoker(ByVal wrapper As
MbUnit.Core.Invokers.IRunInvoker) As MbUnit.Core.Invokers.IRunInvoker
Return New RollbackRunInvoker(wrapper)
End Function
Private Class RollbackRunInvoker
Inherits DecoratorRunInvoker
Public Sub New(ByVal invoker As IRunInvoker)
MyBase.New(invoker)
End Sub
Public Overrides Function Execute(ByVal o As Object, ByVal
args As System.Collections.IList) As Object
Using transScope As New
System.Transactions.TransactionScope
Return Invoker.Execute(o, args)
End Using
End Function
End Class
End Class
End Namespace
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''Sample Usage
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
<Test(), UseTransactinScopeForRollback()> _
Public Sub TestSample1()
End Sub
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/MbUnitUser
-~----------~----~----~----~------~----~------~--~---