using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NavisworksTransport.Utils;

namespace NavisworksTransport.UnitTests.Core
{
    [TestClass]
    public class PathHelperTests
    {
        [TestMethod]
        public void BuildDuplicatedPathName_ShouldRebuildTrailingTimestamp()
        {
            var now = new DateTime(2026, 3, 28, 9, 45, 12);

            var duplicatedName = PathHelper.BuildDuplicatedPathName("人工_0328_081530", now);

            Assert.AreEqual("副本_人工_0328_094512", duplicatedName);
        }

        [TestMethod]
        public void BuildDuplicatedPathName_ShouldKeepPlainNameWithoutTimestamp()
        {
            var duplicatedName = PathHelper.BuildDuplicatedPathName("我的路径");

            Assert.AreEqual("副本_我的路径", duplicatedName);
        }

        [TestMethod]
        public void GenerateCollisionReportFileName_ShouldUseUnifiedChinesePrefixAndTimestamp()
        {
            var now = new DateTime(2026, 4, 9, 23, 55, 1);

            var fileName = PathHelper.GenerateCollisionReportFileName("人工_0409_235000", "html", now);

            Assert.AreEqual("碰撞检测报告_人工_0409_235000_20260409_235501.html", fileName);
        }
    }
}
