-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2c7627
commit f408a40
Showing
15 changed files
with
180 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: nuget | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
nuget-pack: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release | ||
|
||
- name: Test | ||
run: dotnet test --configuration Release | ||
|
||
- name: Pack | ||
run: dotnet pack --configuration Release -p:IncludeSymbols=false -p:SymbolPackageFormat=snupkg -o "packages" | ||
|
||
- name: Push | ||
run: dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using FluentAssertions; | ||
using Microsoft.AspNetCore.SignalR.Client; | ||
using Xunit.Abstractions; | ||
|
||
namespace ManagedCode.IntegrationTestBaseKit.Tests; | ||
|
||
[Collection(nameof(TestApp))] | ||
public class SignalRTests(ITestOutputHelper log, TestApp testApplication) | ||
Check warning on line 8 in ManagedCode.IntegrationTestBaseKit.Tests/SignalRTests.cs
|
||
{ | ||
[Fact] | ||
public async Task HealthTest() | ||
{ | ||
var client = testApplication.CreateSignalRClient("/"); | ||
await client.StartAsync(); | ||
|
||
client.State | ||
.Should() | ||
.Be(HubConnectionState.Connected); | ||
|
||
var result = await client.InvokeAsync<string>("Health"); | ||
result.Should() | ||
.Be("Healthy"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
ManagedCode.IntegrationTestBaseKit.XUnit/BaseXUnitTestApp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Xunit; | ||
|
||
namespace ManagedCode.IntegrationTestBaseKit.XUnit; | ||
|
||
public abstract class BaseXUnitTestApp<TEntryPoint> : BaseTestApp<TEntryPoint>, IAsyncLifetime | ||
where TEntryPoint : class | ||
{ | ||
async Task IAsyncLifetime.DisposeAsync() | ||
{ | ||
await base.DisposeAsync(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
ManagedCode.IntegrationTestBaseKit.XUnit/ManagedCode.IntegrationTestBaseKit.XUnit.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>true</IsPackable> | ||
</PropertyGroup> | ||
|
||
<!--NuGet--> | ||
<PropertyGroup> | ||
<Title>ManagedCode.IntegrationTestBaseKit.XUnit</Title> | ||
<PackageId>ManagedCode.IntegrationTestBaseKit.XUnit</PackageId> | ||
<Description>Extensions for ASP.NET for managing Docker containers in integration tests.</Description> | ||
<PackageTags>managedcode, docker, integration testing, asp.net, containers, testcontainers, csharp</PackageTags> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ManagedCode.IntegrationTestBaseKit\ManagedCode.IntegrationTestBaseKit.csproj"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="xunit" Version="2.9.0"/> | ||
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.2.4"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace TestBlazorApp.Hub; | ||
|
||
public class HealthHub : Microsoft.AspNetCore.SignalR.Hub | ||
{ | ||
public Task<string> Health() | ||
{ | ||
return Task.FromResult("Healthy"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters