Guest User

Untitled

a guest
Jun 13th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. [TestFixture]
  2. public class InheritedFixture
  3. {
  4. protected int _setupValue;
  5. [SetUp]
  6. public void ShouldNotRun()
  7. {
  8. _setupValue = 10;
  9. throw new Exception("This code should not execute.");
  10. }
  11.  
  12. [TearDown]
  13. public void ShouldNotRunAlso()
  14. {
  15. throw new Exception("This code should not execute.");
  16. }
  17. }
  18.  
  19. [TestFixture]
  20. public class SubClass : InheritedFixture
  21. {
  22. [SetUp]
  23. public void ShouldRun()
  24. {
  25.  
  26. }
  27.  
  28. [TearDown]
  29. public void ShouldRunAlso()
  30. {
  31.  
  32. }
  33.  
  34. [Test]
  35. public void Should_pass()
  36. {
  37. Assert.AreNotEqual(10, _setupValue);
  38. }
Add Comment
Please, Sign In to add comment