Skip to content

Commit

Permalink
Added test project for Dapr.Messaging
Browse files Browse the repository at this point in the history
Signed-off-by: Whit Waldo <[email protected]>
  • Loading branch information
WhitWaldo committed Sep 4, 2024
1 parent 6d5ed77 commit 32ce9be
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
7 changes: 7 additions & 0 deletions all.sln
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.Protos", "src\Dapr.Pro
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.Common", "src\Dapr.Common\Dapr.Common.csproj", "{9AB7EB9D-82CB-4BC6-B895-4F52F8DC489F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.Messaging.Test", "test\Dapr.Messaging.Test\Dapr.Messaging.Test.csproj", "{93C6ABAF-F4B7-4CA2-8734-565EF847668A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -308,6 +310,10 @@ Global
{9AB7EB9D-82CB-4BC6-B895-4F52F8DC489F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9AB7EB9D-82CB-4BC6-B895-4F52F8DC489F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9AB7EB9D-82CB-4BC6-B895-4F52F8DC489F}.Release|Any CPU.Build.0 = Release|Any CPU
{93C6ABAF-F4B7-4CA2-8734-565EF847668A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93C6ABAF-F4B7-4CA2-8734-565EF847668A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93C6ABAF-F4B7-4CA2-8734-565EF847668A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93C6ABAF-F4B7-4CA2-8734-565EF847668A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -364,6 +370,7 @@ Global
{250F0236-2014-4DD8-A688-CD25EE299FA3} = {27C5D71D-0721-4221-9286-B94AB07B58CF}
{CE506C30-5701-47C9-A86E-39D796B8DF35} = {27C5D71D-0721-4221-9286-B94AB07B58CF}
{9AB7EB9D-82CB-4BC6-B895-4F52F8DC489F} = {27C5D71D-0721-4221-9286-B94AB07B58CF}
{93C6ABAF-F4B7-4CA2-8734-565EF847668A} = {DD020B34-460F-455F-8D17-CF4A949F100B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {65220BF2-EAE1-4CB2-AA58-EBE80768CB40}
Expand Down
3 changes: 3 additions & 0 deletions src/Dapr.Messaging/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Dapr.Messaging.Test")]

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 6.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 6.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 6.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 6.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (6.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (6.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (6.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (6.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (7.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (7.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (7.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (7.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Build

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Build

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Build

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Build

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 7.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 7.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 7.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 7.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (8.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (8.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (8.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / run integration tests (8.0)

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 8.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 8.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 8.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Check failure on line 3 in src/Dapr.Messaging/AssemblyInfo.cs

View workflow job for this annotation

GitHub Actions / Test .NET 8.0

Friend assembly reference 'Dapr.Messaging.Test' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ internal sealed class DaprPublishSubscribeGrpcClient : DaprPublishSubscribeClien
/// </summary>
private readonly P.DaprClient daprClient;

// property exposed for testing purposes
internal P.DaprClient Client => daprClient;

/// <summary>
/// Creates a new instance of a <see cref="DaprPublishSubscribeGrpcClient"/>
/// </summary>
Expand Down
36 changes: 36 additions & 0 deletions test/Dapr.Messaging.Test/Dapr.Messaging.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Google.Protobuf" Version="3.15.8" />
<PackageReference Include="Grpc.Core.Testing" Version="2.46.3" />
<PackageReference Include="Grpc.Net.Client" Version="2.52.0" />
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="moq" Version="4.14.7" />
<PackageReference Include="protobuf-net.Grpc.AspNetCore" Version="1.0.123" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.8" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Protobuf Include="Protos\test.proto" ProtoRoot="Protos" GrpcServices="Client" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Dapr.Messaging\Dapr.Messaging.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

</Project>
32 changes: 32 additions & 0 deletions test/Dapr.Messaging.Test/Protos/test.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// ------------------------------------------------------------------------
// Copyright 2021 The Dapr Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------

syntax = "proto3";

option csharp_namespace = "Dapr.Client.Autogen.Test.Grpc.v1";

message TestRun {
repeated TestCase tests = 1;
}

message TestCase {
string name = 1;
}

message Request {
string RequestParameter = 1;
}

message Response {
string Name = 1;
}

0 comments on commit 32ce9be

Please sign in to comment.