Skip to content

Creation of Integration Tests #12

@samtrion

Description

@samtrion

Objective

Creation of a new project for integration tests for the NetEvolve.CodeBuilder library.

Project Details

  • Project Name: NetEvolve.CodeBuilder.Tests.Integration
  • Test Framework: TUnit
  • Additional Library: Verify.TUnit
  • Placement: According to the folder structure decision under tests/

Requirements

  • Comply with the folder structure decision (2025-07-10-folder-structure-and-naming-conventions.md)
  • Adhere to C# development guidelines, particularly:
    • Use of C# 13
    • Use of TUnit framework
    • Use of Verify.TUnit library for snapshot tests
    • No mocking frameworks

Project Structure

tests/
├── NetEvolve.CodeBuilder.Tests.Unit/         # Existing
└── NetEvolve.CodeBuilder.Tests.Integration/  # To be created

Project File

The project file should be structured similar to the existing unit test project file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>$(_TestTargetFrameworks)</TargetFrameworks>
    <OutputType>Exe</OutputType>
    <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
    <NoWarn>$(NoWarn);CA2000;S2930</NoWarn>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
    <PackageReference Include="NetEvolve.Extensions.TUnit" />
    <PackageReference Include="TUnit" />
    <PackageReference Include="Verify.TUnit" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\src\NetEvolve.CodeBuilder\NetEvolve.CodeBuilder.csproj" />
  </ItemGroup>
  <ItemGroup>
    <AssemblyAttribute Include="NetEvolve.Extensions.TUnit.IntegrationTestAttribute" />
  </ItemGroup>
</Project>

Update Directory.Packages.props

The Directory.Packages.props file needs to be extended with the Verify.TUnit packages:

<ItemGroup>
  <!-- Existing entries -->
  <PackageVersion Include="Verify.TUnit" Version="[current version]" />
</ItemGroup>

Test Coverage

  • Create end-to-end tests for the CodeBuilder classes
  • Test the generation of complex code blocks
  • Verify formatting options
  • Verify generated outputs using snapshot tests

Notes

  • Do not use "Act", "Arrange", "Assert" comments in tests
  • Apply integration test attributes correctly
  • Follow naming conventions from existing tests

Metadata

Metadata

Assignees

Labels

type:choreIndicates some housework that needs to be done.
No fields configured for Technical Debt.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions