Created
September 8, 2011 07:32
-
-
Save marcusoftnet/1202853 to your computer and use it in GitHub Desktop.
StepArgumentTransformation with generics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This throws for me with "Method T CreateUserT is a generic method definition"