-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new testing project for AasxServerBlazor (#303)
* Create new testing project * add <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> * prevent error for duplicate files
- Loading branch information
Showing
15 changed files
with
156 additions
and
52 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
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
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,39 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AutoFixture" Version="4.18.1"/> | ||
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1"/> | ||
<PackageReference Include="coverlet.collector" Version="6.0.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="FluentAssertions" Version="6.12.0"/> | ||
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0-eap1"/> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0"/> | ||
<PackageReference Include="Moq" Version="4.20.70"/> | ||
<PackageReference Include="xunit" Version="2.8.1"/> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Xunit"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AasxServerBlazor\AasxServerBlazor.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
32 changes: 32 additions & 0 deletions
32
src/AasxServerBlazorTests/Configuration/DependencyRegistryTests.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,32 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using AasxServerBlazor.Configuration; | ||
using AasxServerBlazor.Data; | ||
using IO.Swagger.Registry.Lib.V3.Interfaces; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Http; | ||
|
||
public class DependencyRegistryTests | ||
{ | ||
[Fact] | ||
public void Register_ShouldRegisterAllServices() | ||
{ | ||
// Arrange | ||
var services = new ServiceCollection(); | ||
services.AddLogging(); // Add logging services | ||
|
||
// Act | ||
DependencyRegistry.Register(services); | ||
var serviceProvider = services.BuildServiceProvider(); | ||
|
||
// Assert | ||
// Verify Singleton Registrations | ||
serviceProvider.GetService<AASService>().Should().NotBeNull(); | ||
serviceProvider.GetService<CredentialService>().Should().NotBeNull(); | ||
serviceProvider.GetService<IHttpContextAccessor>().Should().NotBeNull(); | ||
serviceProvider.GetService<IRegistryInitializerService>().Should().NotBeNull(); | ||
serviceProvider.GetService<IAuthorizationHandler>().Should().NotBeNull(); | ||
|
||
// Verify Scoped Registrations | ||
serviceProvider.GetService<BlazorSessionService>().Should().NotBeNull(); | ||
} | ||
} |
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,5 @@ | ||
global using Xunit; | ||
global using FluentAssertions; | ||
global using Moq; | ||
global using AutoFixture; | ||
global using AutoFixture.AutoMoq; |
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