tmauldin / mb-unit

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

Add info on TestParameter to DataBindings created by pattern exploration to enable DataSets to provide values across multiple fixtures/test #829

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Following up my question on the users-forum:
http://groups.google.com/group/gallio-user/browse_thread/thread/b070ce86c4c2e974

I would like to submit a patch - my proposal to make the scenario described 
there possible.

Attached is the patch, and a piece of code that utilizes the change in a crude 
fashion for demonstration purpose.

The behavioral change is only to PatternTestParameter.cs line 106.
While debugging I have noticed in PatternTestDataContext.ResolveDataSource 
which is used when creating parameters that when a parameter does not have an 
associated DataSource (e.g. using ColumnAttribute) it will try to use the data 
source of the first ancestor that has one (and the root pattern scope alway 
does). So part of the functionality is already there. The ancestor's data 
source will now need some more info about the parameter, because it lacks the 
context for "index" and "path".

I have altered the framework code so that every parameter created while 
exploring patterns uses a new DataBinding subclass with a reference to the 
TestParameter that the ancestor data source can use at its convenience.

Hopefully, the changes are in-line with the framework's architecture and can be 
included in the production version.

If needed I am happy to discuss the change further.

Best regards!

Original issue reported on code.google.com by zla...@gmail.com on 27 Mar 2011 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago
Applied.
Thanks.

Original comment by Yann.Tre...@gmail.com on 1 Apr 2011 at 7:14