Forge
csharp3407750f
1using AgentForge.Plugin.Ci.Ir;
2
3namespace AgentForge.Tests;
4
5public sealed class ForgeCiPlanBuilderTests
6{
7 [Fact]
8 public void Build_orders_tasks_by_dependsOn_edges()
9 {
10 var document = ForgeCiTemplates.CreateDefault("default");
11 var plan = ForgeCiPlanBuilder.Build(document);
12
13 Assert.Equal(["dotnet.restore", "dotnet.build", "dotnet.test"], plan.Select(p => p.TaskId));
14 }
15
16 [Fact]
17 public void Build_throws_when_no_tasks()
18 {
19 var document = new ForgeCiDocument
20 {
21 Name = "empty",
22 Nodes = [new ForgeCiNode { Id = "note", Kind = "comment", Body = "noop" }],
23 };
24
25 Assert.Throws<ForgeCiValidationException>(() => ForgeCiPlanBuilder.Build(document));
26 }
27}
28
View only · write via MCP/CIDE