Skip to content

Commit ca400b6

Browse files
committed
Feat: Added Tests
1 parent 5783f7a commit ca400b6

File tree

13 files changed

+188
-7
lines changed

13 files changed

+188
-7
lines changed

CodeOfChaos.Extensions.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.Micr
4646
EndProject
4747
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.FluentValidation", "src\CodeOfChaos.Extensions.FluentValidation\CodeOfChaos.Extensions.FluentValidation.csproj", "{6A293FAD-9E0C-4747-B2DE-AE6504E4CB4F}"
4848
EndProject
49+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.CodeOfChaos.Extensions.FluentValidation", "tests\Tests.CodeOfChaos.Extensions.FluentValidation\Tests.CodeOfChaos.Extensions.FluentValidation.csproj", "{0FFD99C9-3768-4E39-924D-D6847ABEC082}"
50+
EndProject
4951
Global
5052
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5153
Debug|Any CPU = Debug|Any CPU
@@ -124,6 +126,10 @@ Global
124126
{6A293FAD-9E0C-4747-B2DE-AE6504E4CB4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
125127
{6A293FAD-9E0C-4747-B2DE-AE6504E4CB4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
126128
{6A293FAD-9E0C-4747-B2DE-AE6504E4CB4F}.Release|Any CPU.Build.0 = Release|Any CPU
129+
{0FFD99C9-3768-4E39-924D-D6847ABEC082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
130+
{0FFD99C9-3768-4E39-924D-D6847ABEC082}.Debug|Any CPU.Build.0 = Debug|Any CPU
131+
{0FFD99C9-3768-4E39-924D-D6847ABEC082}.Release|Any CPU.ActiveCfg = Release|Any CPU
132+
{0FFD99C9-3768-4E39-924D-D6847ABEC082}.Release|Any CPU.Build.0 = Release|Any CPU
127133
EndGlobalSection
128134
GlobalSection(NestedProjects) = preSolution
129135
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
@@ -145,5 +151,6 @@ Global
145151
{E1F41678-9171-42C9-8877-F326D878AE05} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
146152
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
147153
{6A293FAD-9E0C-4747-B2DE-AE6504E4CB4F} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
154+
{0FFD99C9-3768-4E39-924D-D6847ABEC082} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
148155
EndGlobalSection
149156
EndGlobal

src/CodeOfChaos.Extensions.AspNetCore/LoggingOverrideExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static WebApplicationBuilder OverrideLoggingWithSerilog(
3838
// Clear default providers and setup Serilog
3939
builder.Logging.ClearProviders();
4040
builder.Logging.AddSerilog(Log.Logger);
41+
builder.Services.AddSingleton(Log.Logger);
4142

4243
builder.Services.AddHostedService<ApplicationShutdownLoggerCleanup>(); // Ensure cleanup
4344
builder.Services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(Log.Logger));

tests/Tests.CodeOfChaos.Extensions.Analyzers/Tests.CodeOfChaos.Extensions.Analyzers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="CodeOfChaos.Testing.TUnit" Version="0.7.2" />
14-
<PackageReference Include="TUnit" Version="0.13.3" />
14+
<PackageReference Include="TUnit" Version="0.13.18" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

tests/Tests.CodeOfChaos.Extensions.AspNetCore/Tests.CodeOfChaos.Extensions.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ItemGroup>
1414
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
1515
<PackageReference Include="Moq" Version="4.20.72"/>
16-
<PackageReference Include="TUnit" Version="0.13.3" />
16+
<PackageReference Include="TUnit" Version="0.13.18" />
1717
<PackageReference Include="Bogus" Version="35.6.1"/>
1818
</ItemGroup>
1919

tests/Tests.CodeOfChaos.Extensions.DependencyInjection.Generators/Tests.CodeOfChaos.Extensions.DependencyInjection.Generators.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
2020
<PackageReference Include="Moq" Version="4.20.72" />
2121
<PackageReference Include="System.Formats.Asn1" Version="9.0.2" />
22-
<PackageReference Include="TUnit" Version="0.13.3" />
22+
<PackageReference Include="TUnit" Version="0.13.18" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

tests/Tests.CodeOfChaos.Extensions.DependencyInjection/Tests.CodeOfChaos.Extensions.DependencyInjection.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
1616
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.2" />
1717
<PackageReference Include="Moq" Version="4.20.72" />
18-
<PackageReference Include="TUnit" Version="0.13.3" />
18+
<PackageReference Include="TUnit" Version="0.13.18" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

tests/Tests.CodeOfChaos.Extensions.EntityFrameworkCore/Tests.CodeOfChaos.Extensions.EntityFrameworkCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ItemGroup>
1414
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
1515
<PackageReference Include="Moq" Version="4.20.72"/>
16-
<PackageReference Include="TUnit" Version="0.13.3" />
16+
<PackageReference Include="TUnit" Version="0.13.18" />
1717
<PackageReference Include="Bogus" Version="35.6.1"/>
1818
</ItemGroup>
1919

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// ---------------------------------------------------------------------------------------------------------------------
2+
// Imports
3+
// ---------------------------------------------------------------------------------------------------------------------
4+
namespace Tests.CodeOfChaos.Extensions.FluentValidation.Assets;
5+
6+
// ---------------------------------------------------------------------------------------------------------------------
7+
// Code
8+
// ---------------------------------------------------------------------------------------------------------------------
9+
public class TestModel {
10+
public int Id { get; set; }
11+
public string? Name { get; set; }
12+
}
13+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
9+
<IsPackable>false</IsPackable>
10+
<IsTestProject>true</IsTestProject>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
15+
<PackageReference Include="Moq" Version="4.20.72"/>
16+
<PackageReference Include="TUnit" Version="0.13.18" />
17+
<PackageReference Include="Bogus" Version="35.6.1"/>
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<ProjectReference Include="..\..\src\CodeOfChaos.Extensions.FluentValidation\CodeOfChaos.Extensions.FluentValidation.csproj"/>
22+
</ItemGroup>
23+
24+
</Project>

0 commit comments

Comments
 (0)