50 lines
1.9 KiB
C#
50 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UVC.Tests.Data;
|
|
|
|
namespace UVC.Tests
|
|
{
|
|
public static class Tester
|
|
{
|
|
|
|
public static void RunAllTests()
|
|
{
|
|
Debug.Log("테스트 시작: DataMapperTests");
|
|
RunDataMapperTests();
|
|
Debug.Log("테스트 완료: DataMapperTests");
|
|
}
|
|
|
|
private static void RunDataMapperTests()
|
|
{
|
|
DataMapperTests test = new DataMapperTests();
|
|
|
|
RunTest("Map_StringProperty_MapsCorrectly", () => test.Map_StringProperty_MapsCorrectly());
|
|
RunTest("Map_IntProperty_MapsCorrectly", () => test.Map_IntProperty_MapsCorrectly());
|
|
RunTest("Map_DoubleProperty_MapsCorrectly", () => test.Map_DoubleProperty_MapsCorrectly());
|
|
RunTest("Map_BoolProperty_MapsCorrectly", () => test.Map_BoolProperty_MapsCorrectly());
|
|
RunTest("Map_DateTimeProperty_MapsCorrectly", () => test.Map_DateTimeProperty_MapsCorrectly());
|
|
RunTest("Map_EnumProperty_MapsCorrectly", () => test.Map_EnumProperty_MapsCorrectly());
|
|
RunTest("Map_AdditionalProperty_AddsToResult", () => test.Map_AdditionalProperty_AddsToResult());
|
|
RunTest("Map_InvalidDateTimeString_ReturnsNull", () => test.Map_InvalidDateTimeString_ReturnsNull());
|
|
RunTest("Map_ComplexObject_MapsAllProperties", () => test.Map_ComplexObject_MapsAllProperties());
|
|
}
|
|
|
|
private static void RunTest(string testName, Action testMethod)
|
|
{
|
|
try
|
|
{
|
|
testMethod();
|
|
Debug.Log($"테스트 성공: {testName}");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Debug.LogError($"테스트 실패: {testName} - {ex.Message}\n{ex.StackTrace}");
|
|
}
|
|
}
|
|
}
|
|
}
|