using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.OpcUa;

namespace ZB.MOM.WW.OtOpcUa.Commons.Tests.OpcUa;

public class EquipmentNodeIdsTests
{
    [Fact]
    public void Variable_with_no_folder_is_equipment_slash_name()
        => EquipmentNodeIds.Variable("eq-1", "", "speed").ShouldBe("eq-1/speed");

    [Fact]
    public void Variable_with_null_folder_is_equipment_slash_name()
        => EquipmentNodeIds.Variable("eq-1", null, "speed").ShouldBe("eq-1/speed");

    [Fact]
    public void Variable_with_folder_is_equipment_slash_folder_slash_name()
        => EquipmentNodeIds.Variable("eq-1", "registers", "speed").ShouldBe("eq-1/registers/speed");

    [Fact]
    public void Variable_with_whitespace_folder_is_equipment_slash_name()
        => EquipmentNodeIds.Variable("eq-1", "   ", "speed").ShouldBe("eq-1/speed");

    [Fact]
    public void SubFolder_is_equipment_slash_folder()
        => EquipmentNodeIds.SubFolder("eq-1", "registers").ShouldBe("eq-1/registers");
}
