Created
August 21, 2011 18:42
-
-
Save serbrech/1160978 to your computer and use it in GitHub Desktop.
Silverlight MSTest TestBase
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 class TestBase | |
{ | |
private Exception _exception; | |
[TestInitialize] | |
public void TestInitialize() | |
{ | |
try | |
{ | |
Initialize(); | |
} | |
catch (Exception exception) | |
{ | |
_exception = exception; | |
} | |
} | |
[TestMethod] | |
public void InitializeTest() | |
{ | |
if (_exception != null) | |
{ | |
throw new InvalidOperationException("Failure running test setup", _exception); | |
} | |
} | |
public virtual void Initialize() { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment