Skip to content

Instantly share code, notes, and snippets.

@marcusoftnet
Created September 8, 2011 07:32
Show Gist options
  • Save marcusoftnet/1202853 to your computer and use it in GitHub Desktop.
Save marcusoftnet/1202853 to your computer and use it in GitHub Desktop.
StepArgumentTransformation with generics
[StepArgumentTransformation]
public T CreateUser<T>(Table table) where T : new()
{
// magic happens here stuff
// or this line
// any case a new T gets created
return table.CreateInstance<T>();
}
[Given(@"this is great if it would work")]
public void GivenThisIsGreatIfItWouldWork(MarcusUser user)
{
Assert.IsNotNull(user);
}
@marcusoftnet
Copy link
Author

This throws for me with "Method T CreateUserT is a generic method definition"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment