Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. [Test] //NUnit attribute
  2. public void SomeTest(){
  3. piece of code that might throw:
  4. NoSuchElementException
  5. TimeOutException
  6. NullPointerException
  7. ElementNotVisibleException and many many others
  8. }
  9.  
  10. [TearDown] //NUnit attribute
  11. public void AfterEveryTest(){
  12. if((TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure))||(TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Error)))
  13. {
  14. NUnitException ex = new NUnitException ();
  15. Console.WriteLine(ex.Message);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement