Created
May 25, 2014 21:25
-
-
Save Zerophase/352e4e065a16b0f83bcf to your computer and use it in GitHub Desktop.
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
public abstract class GenericParserTests<T> | |
where T : IStringParser | |
{ | |
protected abstract string GetInputHeaderSingleDigit(); | |
// creates and returns intance of class inheriting from IStringParser | |
protected T GetParser(string input) | |
{ | |
return (T)Activator.CreateInstance(typeof(T), input); | |
} | |
[Test] | |
public void GetStringVersionFromHeader_SingleDigit_Found() | |
{ | |
string input = GetInputHeaderSingleDigit(); | |
T parser = GetParser(input); | |
bool result = parser.HasCorrectHeader(); | |
Assert.IsFalse(result); | |
} | |
// additional tests | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment