diff --git a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundFactDiscoverer.cs b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundFactDiscoverer.cs index f54586b4c4..9551fd13e9 100644 --- a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundFactDiscoverer.cs +++ b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundFactDiscoverer.cs @@ -10,7 +10,7 @@ namespace Xunit { internal class ForegroundFactDiscoverer : IXunitTestCaseDiscoverer { - readonly FactDiscoverer _inner; + private readonly FactDiscoverer _inner; public ForegroundFactDiscoverer(IMessageSink diagnosticMessageSink) { diff --git a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryAttribute.cs b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryAttribute.cs new file mode 100644 index 0000000000..2c13256d9a --- /dev/null +++ b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryAttribute.cs @@ -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 + { + } +} diff --git a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryDiscoverer.cs b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryDiscoverer.cs new file mode 100644 index 0000000000..7088dbb7b8 --- /dev/null +++ b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Xunit/ForegroundTheoryDiscoverer.cs @@ -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 Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) + { + return _inner.Discover(discoveryOptions, testMethod, factAttribute).Select(t => new ForegroundFactTestCase(t)); + } + } +} \ No newline at end of file