using System; using System.IO; using System.Threading.Tasks; using Xunit; using QuantEngine.Application.Services; namespace QuantEngine.Core.Tests { public class PipelineOrchestratorTests { [Fact] public async Task RunPipelineAsync_ExecutesAll7Steps_AndOutputsJson() { var orchestrator = new PipelineOrchestrator(); var result = await orchestrator.RunPipelineAsync(); Assert.NotNull(result); Assert.Equal("PASS", result.Gate); Assert.Equal(7, result.Steps.Count); foreach (var step in result.Steps) { Assert.True(step.Success); Assert.False(string.IsNullOrEmpty(step.StepName)); Assert.True(step.ElapsedMilliseconds > 0); } var expectedJsonPath = @"C:\Temp\data_feed\Temp\dotnet_pipeline_e2e_v1.json"; Assert.True(File.Exists(expectedJsonPath)); var jsonContent = File.ReadAllText(expectedJsonPath); Assert.Contains("\"gate\": \"PASS\"", jsonContent); } } }