forked from nunit/nunit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test error in TestContextOneTimeTearDownTests (nunit#4928)
* Move the test into testdata * Fix the tests I forgot about * Remoev unneeded null suppression
- Loading branch information
Showing
2 changed files
with
58 additions
and
25 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/NUnitFramework/testdata/TestContextOneTimeTearDownData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt | ||
|
||
using NUnit.Framework; | ||
|
||
namespace NUnit.TestData | ||
{ | ||
[TestFixture] | ||
public class TestContextOneTimeTearDownData | ||
{ | ||
public TestContext.ResultAdapter? ResultInOneTimeTearDown { get; private set; } | ||
|
||
[Test] | ||
public void TestTruth() | ||
{ | ||
Assert.That(true, Is.True); | ||
} | ||
|
||
[Test] | ||
public void TestFalsehood() | ||
{ | ||
Assert.That(false, Is.False); | ||
} | ||
|
||
[Test, Explicit] | ||
public void TestExplicit() | ||
{ | ||
Assert.Pass("Always passes if you run it!"); | ||
} | ||
|
||
[OneTimeTearDown] | ||
public void OneTimeTearDown() | ||
{ | ||
ResultInOneTimeTearDown = TestContext.CurrentContext.Result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters