38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
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 tempRoot = Environment.GetEnvironmentVariable("QE_TEMP_ROOT")
|
|
?? Path.Combine(Directory.GetCurrentDirectory(), "Temp");
|
|
var expectedJsonPath = Path.Combine(tempRoot, "dotnet_pipeline_e2e_v1.json");
|
|
Assert.True(File.Exists(expectedJsonPath));
|
|
|
|
var jsonContent = File.ReadAllText(expectedJsonPath);
|
|
Assert.Contains("\"gate\": \"PASS\"", jsonContent);
|
|
}
|
|
}
|
|
}
|