57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using System;
|
|
using AGVNavigationCore.Models;
|
|
|
|
namespace AGVNavigationCore.Utils
|
|
{
|
|
/// <summary>
|
|
/// DirectionalPathfinder 테스트 실행 프로그램
|
|
///
|
|
/// 사용법:
|
|
/// var runner = new TestRunner();
|
|
/// runner.RunTests();
|
|
/// </summary>
|
|
public class TestRunner
|
|
{
|
|
public void RunTests()
|
|
{
|
|
string mapFilePath = @"C:\Data\Source\(5613#) ENIG AGV\Source\Cs_HMI\Data\NewMap.json";
|
|
|
|
var tester = new DirectionalPathfinderTest();
|
|
|
|
// 맵 파일 로드
|
|
if (!tester.LoadMapFile(mapFilePath))
|
|
{
|
|
Console.WriteLine("맵 파일 로드 실패!");
|
|
return;
|
|
}
|
|
|
|
// 모든 노드 정보 출력
|
|
tester.PrintAllNodes();
|
|
|
|
// 테스트 시나리오 1: 001 → 002 → Forward (003 기대)
|
|
tester.PrintNodeInfo(001);
|
|
tester.PrintNodeInfo(002);
|
|
tester.TestDirectionalMovement(001, 002, AgvDirection.Forward);
|
|
|
|
// 테스트 시나리오 2: 002 → 001 → Backward (000 또는 이전 기대)
|
|
tester.TestDirectionalMovement(002, 001, AgvDirection.Backward);
|
|
|
|
// 테스트 시나리오 3: 002 → 003 → Forward
|
|
tester.PrintNodeInfo(003);
|
|
tester.TestDirectionalMovement(002, 003, AgvDirection.Forward);
|
|
|
|
// 테스트 시나리오 4: 003 → 004 → Forward
|
|
tester.PrintNodeInfo(004);
|
|
tester.TestDirectionalMovement(003, 004, AgvDirection.Forward);
|
|
|
|
// 테스트 시나리오 5: 003 → 004 → Right (030 기대)
|
|
tester.TestDirectionalMovement(003, 004, AgvDirection.Right);
|
|
|
|
// 테스트 시나리오 6: 004 → 003 → Backward
|
|
tester.TestDirectionalMovement(004, 003, AgvDirection.Backward);
|
|
|
|
Console.WriteLine("\n\n=== 테스트 완료 ===");
|
|
}
|
|
}
|
|
}
|