?? ??? 3?? DOCX ????XLSX ?? ???HTML ???? ?? ??
- DocumentAssemblerTool? template_path/page_numbers? ??? DOCX ??? ??, ??????????? ?? ??? ?? - ExcelSkill? data_validations? ???? ??/??/?? ?? ??? ?? ??? ?? ?? ?? ?? - HtmlSkill? ArtifactQualityReviewService? decision_summary/evidence_cards ??? ?? ?? ?? ??? ?? - DocumentAssemblerDocxFeaturesTests, HtmlSkillConsultingSectionsTests, ExcelSkillDataValidationTests? ?? ??? ?? - README.md? docs/DEVELOPMENT.md? 2026-04-14 22:28 (KST) ???? ?? ??: - dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_doc_phase_next\\ -p:IntermediateOutputPath=obj\\verify_doc_phase_next\\ (?? 0 / ?? 0) - dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "DocumentAssemblerDocxFeaturesTests|DocumentAssemblerSemanticTests|DocumentPlannerWorkbookScaffoldTests|ExcelSkillExecutiveSummaryLinkTests|ExcelSkillSummarySheetTests|ExcelSkillDataValidationTests|HtmlSkillConsultingSectionsTests|DocxSkillTemplateFeaturesTests|DocumentPlannerBusinessDocumentTests" -p:OutputPath=bin\\verify_doc_phase_next_tests\\ -p:IntermediateOutputPath=obj\\verify_doc_phase_next_tests\\ (?? 9)
This commit is contained in:
@@ -15,9 +15,21 @@ public class DocumentAssemblerDocxFeaturesTests
|
||||
{
|
||||
var workDir = Path.Combine(Path.GetTempPath(), "ax-doc-assemble-features-" + Guid.NewGuid().ToString("N"));
|
||||
Directory.CreateDirectory(workDir);
|
||||
var templatePath = Path.Combine(workDir, "doc-template.docx");
|
||||
|
||||
try
|
||||
{
|
||||
using (var template = WordprocessingDocument.Create(templatePath, DocumentFormat.OpenXml.WordprocessingDocumentType.Document))
|
||||
{
|
||||
var mainPart = template.AddMainDocumentPart();
|
||||
mainPart.Document = new Document(new Body(
|
||||
new Paragraph(new Run(new Text("Template Placeholder"))),
|
||||
new SectionProperties(
|
||||
new PageSize { Width = 15840U, Height = 12240U },
|
||||
new PageMargin { Top = 1080, Right = 1080, Bottom = 1080, Left = 1080 })));
|
||||
mainPart.Document.Save();
|
||||
}
|
||||
|
||||
var tool = new DocumentAssemblerTool();
|
||||
var context = new AgentContext
|
||||
{
|
||||
@@ -34,8 +46,10 @@ public class DocumentAssemblerDocxFeaturesTests
|
||||
"format": "docx",
|
||||
"toc": true,
|
||||
"cover_subtitle": "Q2 Steering Committee",
|
||||
"template_path": "doc-template.docx",
|
||||
"header": "Internal Use Only",
|
||||
"footer": "AX Copilot {page}",
|
||||
"page_numbers": true,
|
||||
"sections": [
|
||||
{ "heading": "1. Executive Summary", "level": 1, "content": "<p>Summary.</p>" },
|
||||
{ "heading": "2. Current State", "level": 1, "content": "<ul><li>Finding A</li><li>Finding B</li></ul>" },
|
||||
@@ -59,6 +73,9 @@ public class DocumentAssemblerDocxFeaturesTests
|
||||
doc.MainDocumentPart.FooterParts.Should().NotBeEmpty();
|
||||
doc.MainDocumentPart.Document.Body!.InnerText.Should().Contain("Q2 Steering Committee");
|
||||
doc.MainDocumentPart.Document.Body.Descendants<FieldCode>().Should().Contain(field => field.Text.Contains("TOC"));
|
||||
doc.MainDocumentPart.FooterParts
|
||||
.SelectMany(part => part.Footer.Descendants<FieldCode>())
|
||||
.Should().Contain(field => field.Text.Contains("PAGE"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using AxCopilot.Services.Agent;
|
||||
using DocumentFormat.OpenXml.Packaging;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
namespace AxCopilot.Tests.Services;
|
||||
|
||||
public class ExcelSkillDataValidationTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WithDataValidations_ShouldPersistValidationRules()
|
||||
{
|
||||
var workDir = Path.Combine(Path.GetTempPath(), "ax-xlsx-validation-" + Guid.NewGuid().ToString("N"));
|
||||
Directory.CreateDirectory(workDir);
|
||||
|
||||
try
|
||||
{
|
||||
var tool = new ExcelSkill();
|
||||
var context = new AgentContext
|
||||
{
|
||||
WorkFolder = workDir,
|
||||
Permission = "Auto",
|
||||
OperationMode = "external",
|
||||
};
|
||||
|
||||
var args = JsonDocument.Parse(
|
||||
"""
|
||||
{
|
||||
"path": "validated.xlsx",
|
||||
"sheet_name": "Tracker",
|
||||
"headers": ["Item", "Status", "Owner"],
|
||||
"rows": [
|
||||
["Task 1", "Open", "Kim"],
|
||||
["Task 2", "Done", "Lee"]
|
||||
],
|
||||
"data_validations": [
|
||||
{
|
||||
"range": "B2:B100",
|
||||
"type": "list",
|
||||
"formula1": "\"Open,In Progress,Done\"",
|
||||
"allow_blank": false,
|
||||
"prompt": "Select a valid status"
|
||||
}
|
||||
]
|
||||
}
|
||||
""").RootElement;
|
||||
|
||||
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
|
||||
|
||||
result.Success.Should().BeTrue();
|
||||
result.Output.Should().Contain("점수");
|
||||
|
||||
var outputPath = Path.Combine(workDir, "validated.xlsx");
|
||||
File.Exists(outputPath).Should().BeTrue();
|
||||
|
||||
using var doc = SpreadsheetDocument.Open(outputPath, false);
|
||||
var firstSheet = doc.WorkbookPart!.Workbook.Sheets!.Elements<Sheet>().First();
|
||||
var worksheetPart = (WorksheetPart)doc.WorkbookPart.GetPartById(firstSheet.Id!);
|
||||
worksheetPart.Worksheet.Elements<DataValidations>().Should().ContainSingle();
|
||||
worksheetPart.Worksheet.Descendants<DataValidation>().Should().ContainSingle();
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(workDir))
|
||||
Directory.Delete(workDir, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,29 +28,44 @@ public class HtmlSkillConsultingSectionsTests
|
||||
"""
|
||||
{
|
||||
"path": "consulting.html",
|
||||
"title": "전략 리뷰",
|
||||
"title": "Executive Report",
|
||||
"body": "",
|
||||
"sections": [
|
||||
{
|
||||
"type": "comparison",
|
||||
"title": "옵션 비교",
|
||||
"title": "Option Comparison",
|
||||
"items": [
|
||||
{ "name": "Option A", "summary": "빠른 실행", "pros": "도입이 쉽다", "cons": "확장성 제약", "verdict": "Fast" }
|
||||
{ "name": "Option A", "summary": "Fast rollout", "pros": "Low setup effort", "cons": "Limited scale", "verdict": "Fast" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "roadmap",
|
||||
"title": "실행 로드맵",
|
||||
"title": "Delivery Roadmap",
|
||||
"phases": [
|
||||
{ "title": "Phase 1", "detail": "진단 및 설계", "timeline": "0-30일", "owner": "PMO" }
|
||||
{ "title": "Phase 1", "detail": "Assess and design", "timeline": "0-30 days", "owner": "PMO" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "matrix",
|
||||
"title": "우선순위 매트릭스",
|
||||
"title": "Priority Matrix",
|
||||
"quadrants": [
|
||||
{ "title": "Quick Wins", "items": ["자동화 과제", "리포트 표준화"] },
|
||||
{ "title": "Strategic Bets", "items": ["플랫폼 재구성"] }
|
||||
{ "title": "Quick Wins", "items": ["Automate reporting", "Standardize templates"] },
|
||||
{ "title": "Strategic Bets", "items": ["Operating model redesign"] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "decision_summary",
|
||||
"title": "Decision",
|
||||
"decision": "Approve pilot expansion",
|
||||
"rationale": "Retention and margin improved in the pilot region.",
|
||||
"actions": ["Approve budget", "Launch phase 2"]
|
||||
},
|
||||
{
|
||||
"type": "evidence_cards",
|
||||
"title": "Evidence",
|
||||
"items": [
|
||||
{ "title": "Margin uplift", "detail": "+4.2p improvement after workflow change", "source": "Finance close", "tag": "KPI" },
|
||||
{ "title": "Cycle time", "detail": "Lead time reduced from 12 to 8 days", "source": "PMO tracker", "tag": "Ops" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -64,6 +79,8 @@ public class HtmlSkillConsultingSectionsTests
|
||||
html.Should().Contain("comparison-grid");
|
||||
html.Should().Contain("roadmap-block");
|
||||
html.Should().Contain("matrix-grid");
|
||||
html.Should().Contain("decision-summary");
|
||||
html.Should().Contain("evidence-cards");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user