using ScadaLink.Commons.Entities.Templates;
using Xunit;

namespace ScadaLink.Commons.Tests.Entities;

public class TemplateFolderTests
{
    [Fact]
    public void Constructor_SetsName()
    {
        var folder = new TemplateFolder("Dev");

        Assert.Equal("Dev", folder.Name);
        Assert.Null(folder.ParentFolderId);
        Assert.Equal(0, folder.SortOrder);
    }

    [Fact]
    public void Constructor_NullName_Throws()
    {
        Assert.Throws<ArgumentNullException>(() => new TemplateFolder(null!));
    }

    [Fact]
    public void Template_FolderId_DefaultsToNull()
    {
        var template = new Template("X");
        Assert.Null(template.FolderId);
    }
}
