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.
Merge pull request nunit#4773 from stevenaw/4584-selection-issue
Test selection issue with normalized newlines
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,34 @@ | ||
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt | ||
|
||
using NUnit.Framework.Internal; | ||
using NUnit.Framework.Internal.Execution; | ||
using NUnit.Framework.Tests.TestUtilities; | ||
using NUnit.TestData.TestCaseSourceAttributeFixture; | ||
|
||
namespace NUnit.Framework.Tests | ||
{ | ||
[TestFixture] | ||
public class Issue4584 | ||
{ | ||
[Test] | ||
public void DiscoverAndExecution() | ||
{ | ||
var fixtureType = typeof(TestCaseSourceAttributeFixture.SelectionFail); | ||
var methodName = nameof(TestCaseSourceAttributeFixture.SelectionFail.Test); | ||
var fixture = TestBuilder.MakeTestFromMethod(fixtureType, methodName); | ||
|
||
foreach (var test in fixture.Tests) | ||
{ | ||
var filter = TestFilter.FromXml( | ||
$"<filter><name>{test.Name}</name></filter>"); | ||
WorkItem? workItem = WorkItemBuilder.CreateWorkItem(fixture, filter, recursive: true); | ||
|
||
Assert.That(workItem, Is.Not.Null); | ||
Assert.That(workItem, Is.InstanceOf<CompositeWorkItem>()); | ||
|
||
var compositeWorkItem = (CompositeWorkItem)workItem; | ||
Assert.That(compositeWorkItem.Children, Has.Count.EqualTo(1)); | ||
} | ||
} | ||
} | ||
} |