Skip to content

Integrate Shmueli's ComServer into CsWinRT #1995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Projections/Test/Test.csproj
Original file line number Diff line number Diff line change
@@ -8,11 +8,12 @@
<ItemGroup>
<ProjectReference Include="..\..\Tests\TestComponentCSharp\TestComponentCSharp.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\TestComponent\TestComponent.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\test_component_base\test_component_base.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\test_component_derived\test_component_derived.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\test_component_base\test_component_base.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\test_component_derived\test_component_derived.vcxproj" />
<ProjectReference Include="..\..\TestWinRT\test_component_fast\test_component_fast.vcxproj" />
<PackageReference Include="System.Numerics.Vectors" />
<ProjectReference Include="..\..\WinRT.Runtime\WinRT.Runtime.csproj" />
<ProjectReference Include="..\..\ComServerHelpers\ComServerHelpers.csproj"/>
<ProjectReference Include="..\..\cswinrt\cswinrt.vcxproj" />
<ProjectReference Include="..\Windows\Windows.csproj" />
<ProjectReference Include="..\WinAppSDK\WinAppSDK.csproj" />
37 changes: 37 additions & 0 deletions src/Tests/UnitTest/ComServerHelperTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#if NET8_0_OR_GREATER
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using ComServerHelpers;
using ComServerHelpers.CsWinRT;
using Windows.Foundation;
using Xunit;

namespace UnitTest
{
public class ComServerHelperTests
{

[Fact]
public void TestCOMRegistrationAndActivation()
{
ComServer server = new ComServer();
OOPAsyncAction obj = new OOPAsyncAction();
server.RegisterClass<OOPAsyncAction, IAsyncAction>(() => { return obj; });
server.Start();

var currentExecutingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var launchExePath = $"{currentExecutingDir}\\OOPExe.exe";
var proc = Process.Start(launchExePath);

Thread.Sleep(5000);
obj.Close();
Assert.True(obj.delegateCalled);
server.Dispose();
}
}
}
#endif
Loading
Oops, something went wrong.