Skip to content

Instantly share code, notes, and snippets.

@serbrech
Created August 21, 2011 18:42
Show Gist options
  • Save serbrech/1160978 to your computer and use it in GitHub Desktop.
Save serbrech/1160978 to your computer and use it in GitHub Desktop.
Silverlight MSTest TestBase
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