tkpatro123 / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Patch: Add support for custom dynamic AOP for test fixture types and method #846

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Following my last patch
http://code.google.com/p/mb-unit/issues/detail?id=829
that enabled the use of IoC Containers as a source for test parameters, I would 
like to propose another patch that would allow reuse of any existing dynamic 
AOP framework for the test types and its methods.

A global hook on instantialization of test types and invocation of test methods 
makes it possible to amend these concerns without touching any other features 
of Gallio or rewriting substantial parts of Test exploration code.

Attached is the patch to Gallio v3.
The other file, CustomDynamicAopForAllTestsInAssembly.cs contains some test 
scenario that utilizes the new feature. It is best to read it for more 
explanation.

I have tried to minimize changes to the codebase and this is what I came up 
with.
The hardest part to decide was how to get all TestMethodPatternAttribute 
inheriting attributes invoke through the same MethodInvocationSpec that was 
created in TestmethodPatternAttribute.SetTestSemantics.

IMHO that area of Gallio could really use some refactoring (e.g. abstraction to 
interfaces and more granular single point responsibilities for 
PatternTestInstanceState, MethodInvocationSpec, ObjectCreationSpec; also of 
benefit would be the unfication of invocation concern in MethodInvocationSpec 
and 
Gallio.Framework.Pattern.Gallio.Framework.Pattern.FixtureMemberInvoker<TOutput>)
.

Hope this change is in line with Gallio architecture too. I am happy to discuss 
the changes further if needed.

Best Regards,
Zlamma

Original issue reported on code.google.com by zla...@gmail.com on 12 Jun 2011 at 1:30

Attachments: