Add [ForegroundTheory]
This commit is contained in:
parent
00dc95098f
commit
5ee4c8ec4d
|
|
@ -10,7 +10,7 @@ namespace Xunit
|
||||||
{
|
{
|
||||||
internal class ForegroundFactDiscoverer : IXunitTestCaseDiscoverer
|
internal class ForegroundFactDiscoverer : IXunitTestCaseDiscoverer
|
||||||
{
|
{
|
||||||
readonly FactDiscoverer _inner;
|
private readonly FactDiscoverer _inner;
|
||||||
|
|
||||||
public ForegroundFactDiscoverer(IMessageSink diagnosticMessageSink)
|
public ForegroundFactDiscoverer(IMessageSink diagnosticMessageSink)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Xunit.Sdk;
|
||||||
|
|
||||||
|
namespace Xunit
|
||||||
|
{
|
||||||
|
// Similar to WpfTheoryAttribute https://github.com/xunit/samples.xunit/blob/969d9f7e887836f01a6c525324bf3db55658c28f/STAExamples/WpfTheoryAttribute.cs
|
||||||
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
||||||
|
[XunitTestCaseDiscoverer("Xunit.ForegroundTheoryDiscoverer", "Microsoft.VisualStudio.LanguageServices.Razor.Test")]
|
||||||
|
internal class ForegroundTheoryAttribute : TheoryAttribute
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Xunit.Abstractions;
|
||||||
|
using Xunit.Sdk;
|
||||||
|
|
||||||
|
namespace Xunit
|
||||||
|
{
|
||||||
|
internal class ForegroundTheoryDiscoverer : IXunitTestCaseDiscoverer
|
||||||
|
{
|
||||||
|
private readonly TheoryDiscoverer _inner;
|
||||||
|
|
||||||
|
public ForegroundTheoryDiscoverer(IMessageSink diagnosticMessageSink)
|
||||||
|
{
|
||||||
|
_inner = new TheoryDiscoverer(diagnosticMessageSink);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
|
||||||
|
{
|
||||||
|
return _inner.Discover(discoveryOptions, testMethod, factAttribute).Select(t => new ForegroundFactTestCase(t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue