Skip to content

Commit 3b10820

Browse files
committed
Switch to vs-extension-testing for integration tests
1 parent 21711f3 commit 3b10820

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/AbstractIdeIntegrationTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace Tvl.VisualStudio.MouseFastScroll.IntegrationTests
1212
using Tvl.VisualStudio.MouseFastScroll.IntegrationTests.Threading;
1313
using Xunit;
1414

15-
[VsTestSettings(UIThread = true)]
1615
public abstract class AbstractIdeIntegrationTest : IAsyncLifetime, IDisposable
1716
{
1817
private JoinableTaskContext _joinableTaskContext;

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/VsFactTest.cs renamed to Tvl.VisualStudio.MouseFastScroll.IntegrationTests/IdeFactTest.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,38 @@ namespace Tvl.VisualStudio.MouseFastScroll.IntegrationTests
77
using System.Threading;
88
using System.Threading.Tasks;
99
using System.Windows;
10-
using System.Windows.Threading;
1110
using Microsoft.VisualStudio.Shell.Interop;
1211
using Microsoft.VisualStudio.Threading;
13-
using Tvl.VisualStudio.MouseFastScroll.IntegrationTests.Threading;
1412
using Xunit;
1513
using _DTE = EnvDTE._DTE;
1614
using DTE = EnvDTE.DTE;
1715
using ServiceProvider = Microsoft.VisualStudio.Shell.ServiceProvider;
1816

19-
public class VsFactTest : AbstractIdeIntegrationTest
17+
public class IdeFactTest : AbstractIdeIntegrationTest
2018
{
21-
[VsFact]
19+
[IdeFact]
2220
public void TestOpenAndCloseIDE()
2321
{
2422
Assert.Equal("devenv", Process.GetCurrentProcess().ProcessName);
2523
var dte = (DTE)ServiceProvider.GetService(typeof(_DTE));
2624
Assert.NotNull(dte);
2725
}
2826

29-
[VsFact]
27+
[IdeFact]
3028
public void TestRunsOnUIThread()
3129
{
3230
Assert.True(Application.Current.Dispatcher.CheckAccess());
3331
}
3432

35-
[VsFact]
33+
[IdeFact]
3634
public async Task TestRunsOnUIThreadAsync()
3735
{
3836
Assert.True(Application.Current.Dispatcher.CheckAccess());
3937
await Task.Yield();
4038
Assert.True(Application.Current.Dispatcher.CheckAccess());
4139
}
4240

43-
[VsFact]
41+
[IdeFact]
4442
public async Task TestYieldsToWorkAsync()
4543
{
4644
Assert.True(Application.Current.Dispatcher.CheckAccess());
@@ -52,7 +50,7 @@ public async Task TestYieldsToWorkAsync()
5250
Assert.True(Application.Current.Dispatcher.CheckAccess());
5351
}
5452

55-
[VsFact]
53+
[IdeFact]
5654
public async Task TestJoinableTaskFactoryAsync()
5755
{
5856
Assert.NotNull(JoinableTaskContext);
@@ -68,8 +66,7 @@ public async Task TestJoinableTaskFactoryAsync()
6866
Assert.Equal(Thread.CurrentThread, JoinableTaskContext.MainThread);
6967
}
7068

71-
#if DEBUG // https://github.com/josetr/VsixTesting/issues/3
72-
[VsFact(Version = "2012")]
69+
[IdeFact(MinVersion = VisualStudioVersion.VS2012, MaxVersion = VisualStudioVersion.VS2012)]
7370
public void TestJoinableTaskFactoryProvidedByTest()
7471
{
7572
var taskSchedulerServiceObject = ServiceProvider.GetService(typeof(SVsTaskSchedulerService));
@@ -83,9 +80,8 @@ public void TestJoinableTaskFactoryProvidedByTest()
8380

8481
Assert.NotNull(JoinableTaskContext);
8582
}
86-
#endif
8783

88-
[VsFact(Version = "2013-")]
84+
[IdeFact(MinVersion = VisualStudioVersion.VS2013)]
8985
public void TestJoinableTaskFactoryObtainedFromEnvironment()
9086
{
9187
var taskSchedulerServiceObject = ServiceProvider.GetService(typeof(SVsTaskSchedulerService));

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/ScrollingIntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private IdeSendKeys SendKeys
4242
get;
4343
}
4444

45-
[VsFact]
45+
[IdeFact]
4646
public async Task BasicScrollingBehaviorAsync()
4747
{
4848
var dte = (DTE)ServiceProvider.GetService(typeof(_DTE));
@@ -128,7 +128,7 @@ await SendKeys.SendAsync(inputSimulator =>
128128
/// <summary>
129129
/// Verifies that the Ctrl+Scroll operations do not change the zoom level in the editor.
130130
/// </summary>
131-
[VsFact]
131+
[IdeFact]
132132
public async Task ZoomDisabledAsync()
133133
{
134134
var dte = (DTE)ServiceProvider.GetService(typeof(_DTE));

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/Tvl.VisualStudio.MouseFastScroll.IntegrationTests.csproj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@
1010

1111
<ItemGroup>
1212
<Reference Include="Microsoft.CSharp" />
13-
<Reference Include="System.Runtime.Remoting" />
1413
</ItemGroup>
1514

1615
<ItemGroup>
1716
<PackageReference Include="InputSimulatorPlus" Version="1.0.6" />
17+
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Testing.Xunit.Legacy" Version="0.1.71-beta" />
1818
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="12.0.0" />
1919
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.12.0" Version="12.0.30111" />
2020
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" Version="14.3.26929" />
2121
<PackageReference Include="VSSDK.ComponentModelHost.11" Version="11.0.4" />
2222
<PackageReference Include="VSSDK.DTE.8" Version="8.0.4" />
2323
<PackageReference Include="VSSDK.Shell.11" Version="11.0.4" />
2424
<PackageReference Include="VSSDK.Text" Version="11.0.4" />
25-
<PackageReference Include="VsixTesting.Xunit" Version="0.1.54-beta" />
2625
<PackageReference Include="xunit" Version="2.4.1" />
2726
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
2827
</ItemGroup>
2928

29+
<ItemGroup>
30+
<AssemblyAttribute Include="Xunit.Harness.RequireExtensionAttribute">
31+
<_Parameter1>Tvl.VisualStudio.MouseFastScroll.vsix</_Parameter1>
32+
</AssemblyAttribute>
33+
</ItemGroup>
34+
3035
<ItemGroup>
3136
<ProjectReference Include="..\Tvl.VisualStudio.MouseFastScroll\Tvl.VisualStudio.MouseFastScroll.csproj" ReferenceOutputAssembly="false" CopyVsix="true" />
3237
</ItemGroup>
@@ -36,9 +41,9 @@
3641
DependsOnTargets="PrepareProjectReferences">
3742
<MSBuild
3843
Projects="@(_MSBuildProjectReferenceExistent)"
39-
Targets="Build;VSIXContainerProjectOutputGroup"
44+
Targets="VSIXContainerProjectOutputGroup"
4045
BuildInParallel="$(BuildInParallel)"
41-
Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
46+
Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework); CreateVsixContainer=true"
4247
Condition="'%(_MSBuildProjectReferenceExistent.CopyVsix)' == 'true'"
4348
ContinueOnError="!$(BuildingProject)"
4449
RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
@@ -47,7 +52,7 @@
4752
</MSBuild>
4853

4954
<ItemGroup>
50-
<None Include="@(_ProjectReferenceVsixOutputs)" Condition="Exists('%(Identity)')" CopyToOutputDirectory="PreserveNewest" />
55+
<ReferenceCopyLocalPaths Include="@(_ProjectReferenceVsixOutputs)" />
5156
</ItemGroup>
5257
</Target>
5358

appveyor.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ test_script:
2828
-target:"$env:xunit20\xunit.console.x86.exe" `
2929
-targetargs:"$unitTestAssembly -appveyor -noshadow"
3030
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
31-
#&$openCoverConsole `
32-
# -register:user `
33-
# -returntargetcode `
34-
# -hideskipped:All `
35-
# -filter:"+[Tvl*]*" `
36-
# -excludebyattribute:*.ExcludeFromCodeCoverage* `
37-
# -excludebyfile:*\*Designer.cs `
38-
# -searchdirs:"Tvl.VisualStudio.MouseFastScroll.UnitTests\bin\$env:CONFIGURATION\net452" `
39-
# -output:OpenCover.MouseFastScroll.IntegrationTests.xml `
40-
# -target:"$env:xunit20\xunit.console.x86.exe" `
41-
# -targetargs:"$integrationTestAssembly -appveyor -noshadow"
42-
#if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
31+
&$openCoverConsole `
32+
-register:user `
33+
-returntargetcode `
34+
-hideskipped:All `
35+
-filter:"+[Tvl*]*" `
36+
-excludebyattribute:*.ExcludeFromCodeCoverage* `
37+
-excludebyfile:*\*Designer.cs `
38+
-searchdirs:"Tvl.VisualStudio.MouseFastScroll.UnitTests\bin\$env:CONFIGURATION\net452" `
39+
-output:OpenCover.MouseFastScroll.IntegrationTests.xml `
40+
-target:"$env:xunit20\xunit.console.x86.exe" `
41+
-targetargs:"$integrationTestAssembly -appveyor -noshadow"
42+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
4343
&$codecov -f OpenCover.MouseFastScroll.UnitTests.xml --flag unit
44-
#&$codecov -f OpenCover.MouseFastScroll.IntegrationTests.xml --flag integration
44+
&$codecov -f OpenCover.MouseFastScroll.IntegrationTests.xml --flag integration
4545
artifacts:
4646
- path: 'Tvl.VisualStudio.MouseFastScroll\**\*.vsix'
4747
- path: '\msbuild.binlog'

0 commit comments

Comments
 (0)