Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Fill generic type parameters from types in examples #152

Open
adamralph opened this issue May 15, 2014 · 2 comments
Open

Fill generic type parameters from types in examples #152

adamralph opened this issue May 15, 2014 · 2 comments
Labels
enhancement New feature or request

Comments

@adamralph
Copy link
Owner

E.g.

[Scenario]
[Example(typeof(RedWidget))]
[Example(typeof(BlueWidget))]
public static void MungingWidgets<TWidget>(TWidget widget)
    where TWidget: IWidget, new()
{
    "Given a {0}"
        .f(() => widget = new TWidget());

    "When I..."
        ....
}
@adamralph adamralph changed the title Fill generic type parameters from examples Fill generic type parameters from types in examples Dec 5, 2014
@adamralph
Copy link
Owner Author

Need to think of another way to do it. The example shown would close the method with the type parameter being System.Type and will always do so unless we special case System.Type, which is just ugly.

@adamralph
Copy link
Owner Author

We could introduce a special type as a wrapper for types. E.g.

[Scenario]
[Example(typeof(ExampleType<RedWidget>))]
[Example(typeof(ExampleType<BlueWidget>))]
public static void MungingWidgets<TWidget>(TWidget widget)
    where TWidget: IWidget, new()
{
    "Given a {0}"
        .f(() => widget = new TWidget());
    ...
}

@adamralph adamralph added the P2 label Apr 23, 2016
@adamralph adamralph added P3 and removed P2 labels Sep 22, 2018
@adamralph adamralph removed the P3 label Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant