Merge branch 'rynowak/foreground-theory' into dev

This commit is contained in:
Ryan Nowak 2017-09-07 13:07:13 -07:00
commit 1806d26e9a
3 changed files with 41 additions and 1 deletions

View File

@ -10,7 +10,7 @@ namespace Xunit
{
internal class ForegroundFactDiscoverer : IXunitTestCaseDiscoverer
{
readonly FactDiscoverer _inner;
private readonly FactDiscoverer _inner;
public ForegroundFactDiscoverer(IMessageSink diagnosticMessageSink)
{

View File

@ -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
{
}
}

View File

@ -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));
}
}
}