Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3e1f60f

Browse files
committed
Add integration test for ShowGitHubPane
Simple integration test for GitHub.ShowGitHubPane command that will execute on Visual Studio 2015 and 2017.
1 parent a1bad3a commit 3e1f60f

6 files changed

Lines changed: 238 additions & 0 deletions

File tree

GitHubVS.sln

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.VisualStudio.UnitTes
125125
EndProject
126126
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Resources", "src\GitHub.Resources\GitHub.Resources.csproj", "{54E8D71A-AABB-4698-95FE-7F11612B8E59}"
127127
EndProject
128+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "test\IntegrationTests\IntegrationTests.csproj", "{BF6D17FE-15FD-401C-B5D7-DE21837231F1}"
129+
EndProject
128130
Global
129131
GlobalSection(SolutionConfigurationPlatforms) = preSolution
130132
Debug|Any CPU = Debug|Any CPU
@@ -504,6 +506,16 @@ Global
504506
{54E8D71A-AABB-4698-95FE-7F11612B8E59}.Release|Any CPU.Build.0 = Release|Any CPU
505507
{54E8D71A-AABB-4698-95FE-7F11612B8E59}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
506508
{54E8D71A-AABB-4698-95FE-7F11612B8E59}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
509+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
510+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
511+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.DebugCodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU
512+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.DebugCodeAnalysis|Any CPU.Build.0 = Debug|Any CPU
513+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.DebugWithoutVsix|Any CPU.ActiveCfg = Debug|Any CPU
514+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.DebugWithoutVsix|Any CPU.Build.0 = Debug|Any CPU
515+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
516+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.Release|Any CPU.Build.0 = Release|Any CPU
517+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
518+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
507519
EndGlobalSection
508520
GlobalSection(SolutionProperties) = preSolution
509521
HideSolutionNode = FALSE
@@ -534,6 +546,7 @@ Global
534546
{DE704BBB-6EC6-4173-B695-D9EBF5AEB092} = {8A7DA2E7-262B-4581-807A-1C45CE79CDFD}
535547
{93778A89-3E58-4853-B772-948EBB3F17BE} = {8A7DA2E7-262B-4581-807A-1C45CE79CDFD}
536548
{8B14F90B-0781-465D-AB94-19C8C56E3A94} = {8A7DA2E7-262B-4581-807A-1C45CE79CDFD}
549+
{BF6D17FE-15FD-401C-B5D7-DE21837231F1} = {8A7DA2E7-262B-4581-807A-1C45CE79CDFD}
537550
EndGlobalSection
538551
GlobalSection(ExtensibilityGlobals) = postSolution
539552
SolutionGuid = {556014CF-5B35-4CE5-B3EF-6AB0007001AC}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\xunit.core.2.4.0\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.4.0\build\xunit.core.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{BF6D17FE-15FD-401C-B5D7-DE21837231F1}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>IntegrationTests</RootNamespace>
12+
<AssemblyName>IntegrationTests</AssemblyName>
13+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
45+
<HintPath>..\..\packages\xunit.abstractions.2.0.2\lib\net35\xunit.abstractions.dll</HintPath>
46+
</Reference>
47+
<Reference Include="xunit.assert, Version=2.4.0.4049, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
48+
<HintPath>..\..\packages\xunit.assert.2.4.0\lib\netstandard2.0\xunit.assert.dll</HintPath>
49+
</Reference>
50+
<Reference Include="xunit.core, Version=2.4.0.4049, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
51+
<HintPath>..\..\packages\xunit.extensibility.core.2.4.0\lib\net452\xunit.core.dll</HintPath>
52+
</Reference>
53+
<Reference Include="xunit.execution.desktop, Version=2.4.0.4049, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
54+
<HintPath>..\..\packages\xunit.extensibility.execution.2.4.0\lib\net452\xunit.execution.desktop.dll</HintPath>
55+
</Reference>
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Compile Include="Class1.cs" />
59+
<Compile Include="Properties\AssemblyInfo.cs" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<None Include="packages.config" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Analyzer Include="..\..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
66+
</ItemGroup>
67+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
69+
<PropertyGroup>
70+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
71+
</PropertyGroup>
72+
<Error Condition="!Exists('..\..\packages\xunit.core.2.4.0\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.4.0\build\xunit.core.props'))" />
73+
<Error Condition="!Exists('..\..\packages\xunit.core.2.4.0\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.4.0\build\xunit.core.targets'))" />
74+
</Target>
75+
<Import Project="..\..\packages\xunit.core.2.4.0\build\xunit.core.targets" Condition="Exists('..\..\packages\xunit.core.2.4.0\build\xunit.core.targets')" />
76+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="xunit" version="2.4.0" targetFramework="net461" />
4+
<package id="xunit.abstractions" version="2.0.2" targetFramework="net461" />
5+
<package id="xunit.analyzers" version="0.10.0" targetFramework="net461" />
6+
<package id="xunit.assert" version="2.4.0" targetFramework="net461" />
7+
<package id="xunit.core" version="2.4.0" targetFramework="net461" />
8+
<package id="xunit.extensibility.core" version="2.4.0" targetFramework="net461" />
9+
<package id="xunit.extensibility.execution" version="2.4.0" targetFramework="net461" />
10+
</packages>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using GitHub.VisualStudio;
2+
using Xunit;
3+
using EnvDTE;
4+
using Microsoft.VisualStudio.Shell;
5+
6+
namespace IntegrationTests
7+
{
8+
public class GitHubPaneIntegrationTests
9+
{
10+
const string GitHubPaneGuid = "{6B0FDC0A-F28E-47A0-8EED-CC296BEFF6D2}";
11+
12+
[VsFact(UIThread = true)]
13+
public void ShowGitHubPane()
14+
{
15+
var dte = (DTE)ServiceProvider.GlobalProvider.GetService(typeof(DTE));
16+
var window = dte.Windows.Item(GitHubPaneGuid);
17+
window.Visible = false;
18+
var command = dte.Commands.Item(Guids.guidGitHubCmdSet, PkgCmdIDList.showGitHubPaneCommand);
19+
20+
Assert.False(window.Visible);
21+
Assert.True(command.IsAvailable);
22+
23+
dte.Commands.Raise(command.Guid, command.ID, null, null);
24+
25+
Assert.True(window.Visible);
26+
}
27+
}
28+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{BF6D17FE-15FD-401C-B5D7-DE21837231F1}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>IntegrationTests</RootNamespace>
11+
<AssemblyName>IntegrationTests</AssemblyName>
12+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<NuGetPackageImportStamp>
15+
</NuGetPackageImportStamp>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="GitHubPaneIntegrationTests.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes">
50+
<Version>15.0.21</Version>
51+
</PackageReference>
52+
<PackageReference Include="Microsoft.VisualStudio.Shell.14.0">
53+
<Version>14.3.25407</Version>
54+
</PackageReference>
55+
<PackageReference Include="VsixTesting.Xunit">
56+
<Version>0.1.27-beta-g899d38d635</Version>
57+
</PackageReference>
58+
<PackageReference Include="xunit">
59+
<Version>2.4.1-pre.build.4059</Version>
60+
</PackageReference>
61+
<PackageReference Include="xunit.runner.visualstudio">
62+
<Version>2.4.1-pre.build.4059</Version>
63+
</PackageReference>
64+
</ItemGroup>
65+
<ItemGroup>
66+
<ProjectReference Include="..\..\src\GitHub.Exports\GitHub.Exports.csproj">
67+
<Project>{9aea02db-02b5-409c-b0ca-115d05331a6b}</Project>
68+
<Name>GitHub.Exports</Name>
69+
</ProjectReference>
70+
</ItemGroup>
71+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
72+
</Project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
using Xunit;
5+
6+
// General Information about an assembly is controlled through the following
7+
// set of attributes. Change these attribute values to modify the information
8+
// associated with an assembly.
9+
[assembly: AssemblyTitle("IntegrationTests")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyProduct("IntegrationTests")]
14+
[assembly: AssemblyCopyright("Copyright © 2018")]
15+
[assembly: AssemblyTrademark("")]
16+
[assembly: AssemblyCulture("")]
17+
18+
// Setting ComVisible to false makes the types in this assembly not visible
19+
// to COM components. If you need to access a type in this assembly from
20+
// COM, set the ComVisible attribute to true on that type.
21+
[assembly: ComVisible(false)]
22+
23+
// The following GUID is for the ID of the typelib if this project is exposed to COM
24+
[assembly: Guid("bf6d17fe-15fd-401c-b5d7-de21837231f1")]
25+
26+
// Version information for an assembly consists of the following four values:
27+
//
28+
// Major Version
29+
// Minor Version
30+
// Build Number
31+
// Revision
32+
//
33+
// You can specify all the values or you can default the Build and Revision Numbers
34+
// by using the '*' as shown below:
35+
// [assembly: AssemblyVersion("1.0.*")]
36+
[assembly: AssemblyVersion("1.0.0.0")]
37+
[assembly: AssemblyFileVersion("1.0.0.0")]
38+
39+
[assembly: TestFramework("Xunit.VsTestFramework", "VsixTesting.Xunit")]

0 commit comments

Comments
 (0)