Adjusting interop tests for 5295 (#5296)

Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
This commit is contained in:
Clint Rutkas
2020-07-30 12:22:33 -07:00
committed by GitHub
parent d032956124
commit a46103fc8c
3 changed files with 179 additions and 167 deletions

View File

@@ -239,7 +239,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interop", "src\common\inter
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common-md-flag", "src\common\common-md-flag\common-md-flag.vcxproj", "{985B3F2F-CEED-4C0A-A249-69257E719145}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common-md-flag", "src\common\common-md-flag\common-md-flag.vcxproj", "{985B3F2F-CEED-4C0A-A249-69257E719145}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "interop-tests", "src\common\interop-tests\interop-tests.csproj", "{437AD818-3F1F-4CA5-A79B-25233A157026}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Interop.Tests", "src\common\interop-tests\Microsoft.Interop.Tests.csproj", "{437AD818-3F1F-4CA5-A79B-25233A157026}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.Folder", "src\modules\launcher\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.csproj", "{787B8AA6-CA93-4C84-96FE-DF31110AD1C4}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.Folder", "src\modules\launcher\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.csproj", "{787B8AA6-CA93-4C84-96FE-DF31110AD1C4}"
EndProject EndProject

View File

@@ -1,25 +1,25 @@
using System; // Copyright (c) Microsoft Corporation
using Microsoft.VisualStudio.TestTools.UnitTesting; // The Microsoft Corporation licenses this file to you under the MIT license.
using System.IO.Pipes; // See the LICENSE file in the project root for more information.
using interop;
using System.IO;
using System.Threading;
using System.Text;
namespace interop_tests using System.Threading;
using interop;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.Interop.Tests
{ {
[TestClass] [TestClass]
public class UnitTest1 public class InteropTests
{ {
private string SERVER_SIDE = "\\\\.\\pipe\\serverside"; private const string ServerSidePipe = "\\\\.\\pipe\\serverside";
private string CLIENT_SIDE = "\\\\.\\pipe\\clientside"; private const string ClientSidePipe = "\\\\.\\pipe\\clientside";
private TwoWayPipeMessageIPCManaged clientPipe; private TwoWayPipeMessageIPCManaged clientPipe;
[TestInitialize] [TestInitialize]
public void Initialize() public void Initialize()
{ {
clientPipe = new TwoWayPipeMessageIPCManaged(CLIENT_SIDE, SERVER_SIDE, null); clientPipe = new TwoWayPipeMessageIPCManaged(ClientSidePipe, ServerSidePipe, null);
} }
[TestCleanup] [TestCleanup]
@@ -35,8 +35,8 @@ namespace interop_tests
var reset = new AutoResetEvent(false); var reset = new AutoResetEvent(false);
var serverPipe = new TwoWayPipeMessageIPCManaged( var serverPipe = new TwoWayPipeMessageIPCManaged(
SERVER_SIDE, ServerSidePipe,
CLIENT_SIDE, ClientSidePipe,
(string msg) => (string msg) =>
{ {
Assert.AreEqual(testString, msg); Assert.AreEqual(testString, msg);
@@ -50,6 +50,5 @@ namespace interop_tests
serverPipe.End(); serverPipe.End();
} }
} }
} }

View File

@@ -41,8 +41,8 @@
<ProjectGuid>{437AD818-3F1F-4CA5-A79B-25233A157026}</ProjectGuid> <ProjectGuid>{437AD818-3F1F-4CA5-A79B-25233A157026}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>interop_tests</RootNamespace> <RootNamespace>Microsoft.Interop.Tests</RootNamespace>
<AssemblyName>interop-tests</AssemblyName> <AssemblyName>Microsoft.Interop.Tests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -85,14 +85,27 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="UnitTest1.cs" /> <Compile Include="..\..\codeAnalysis\GlobalSuppressions.cs">
<Link>GlobalSuppressions.cs</Link>
</Compile>
<Compile Include="InteropTests.cs" />
<Compile Include="Generated Files\AssemblyInfo.cs"> <Compile Include="Generated Files\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AdditionalFiles Include="..\..\codeAnalysis\StyleCop.json">
<Link>StyleCop.json</Link>
</AdditionalFiles>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<Version>1.1.118</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\interop\interop.vcxproj"> <ProjectReference Include="..\interop\interop.vcxproj">
<Project>{f055103b-f80b-4d0c-bf48-057c55620033}</Project> <Project>{f055103b-f80b-4d0c-bf48-057c55620033}</Project>