Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestFixture]
- public class InheritedFixture
- {
- protected int _setupValue;
- [SetUp]
- public void ShouldNotRun()
- {
- _setupValue = 10;
- throw new Exception("This code should not execute.");
- }
- [TearDown]
- public void ShouldNotRunAlso()
- {
- throw new Exception("This code should not execute.");
- }
- }
- [TestFixture]
- public class SubClass : InheritedFixture
- {
- [SetUp]
- public void ShouldRun()
- {
- }
- [TearDown]
- public void ShouldRunAlso()
- {
- }
- [Test]
- public void Should_pass()
- {
- Assert.AreNotEqual(10, _setupValue);
- }
Add Comment
Please, Sign In to add comment