Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test] //NUnit attribute
- public void SomeTest(){
- piece of code that might throw:
- NoSuchElementException
- TimeOutException
- NullPointerException
- ElementNotVisibleException and many many others
- }
- [TearDown] //NUnit attribute
- public void AfterEveryTest(){
- if((TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure))||(TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Error)))
- {
- NUnitException ex = new NUnitException ();
- Console.WriteLine(ex.Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement