cli/test/csharp-integration
renovate[bot] e8127e14d3 chore(deps): update dependency openfeature to 2.6.0 (#131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Adityasinghvats <131326798+Adityasinghvats@users.noreply.github.com>
2025-06-13 09:11:52 +05:30
..
expected feat(csharp): added generator and integration tests (#97) 2025-04-14 17:40:52 +00:00
CompileTest.csproj chore(deps): update dependency openfeature to 2.6.0 (#131) 2025-06-13 09:11:52 +05:30
Dockerfile feat(csharp): added generator and integration tests (#97) 2025-04-14 17:40:52 +00:00
OpenFeature.cs feat(csharp): added generator and integration tests (#97) 2025-04-14 17:40:52 +00:00
Program.cs feat(csharp): added generator and integration tests (#97) 2025-04-14 17:40:52 +00:00
README.md feat: introduce dagger for integration testing and ci (#100) 2025-05-06 18:08:32 +00:00

README.md

C# Integration Testing

This directory contains integration tests for the C# code generator.

Running the tests

Run the C# integration tests with Dagger:

make test-csharp-dagger

This will:

  1. Build the OpenFeature CLI
  2. Generate C# client code using the sample manifest
  3. Run the C# compilation test in an isolated environment
  4. Report success or failure

What the test does

The integration test:

  1. Builds the OpenFeature CLI inside a container
  2. Generates C# client code using a sample manifest
  3. Compiles the generated code with a sample program
  4. Runs the compiled program to verify it works correctly

Test Files

  • CompileTest.csproj: .NET project file for compilation testing
  • Program.cs: Test program that uses the generated code
  • expected/: Directory containing expected output files (used for verification)

Implementation

The C# integration test uses Dagger to create a reproducible test environment:

  1. It builds the CLI in a Go container
  2. Generates C# code using the CLI
  3. Tests the generated code in a .NET container

The implementation is located in test/integration/cmd/csharp/run.go.

For more implementation details, see the main test/README.md file.