using SharepointToolbox.Core.Models;
using SharepointToolbox.Services;

namespace SharepointToolbox.Tests.Services;

public class TemplateServiceTests
{
    [Fact]
    public void TemplateService_Implements_ITemplateService()
    {
        Assert.True(typeof(ITemplateService).IsAssignableFrom(typeof(TemplateService)));
    }

    [Fact]
    public void SiteTemplate_DefaultValues_AreCorrect()
    {
        var template = new SiteTemplate();
        Assert.NotNull(template.Id);
        Assert.NotEmpty(template.Id);
        Assert.NotNull(template.Libraries);
        Assert.Empty(template.Libraries);
        Assert.NotNull(template.PermissionGroups);
        Assert.Empty(template.PermissionGroups);
        Assert.NotNull(template.Options);
    }

    [Fact]
    public void SiteTemplateOptions_AllDefaultTrue()
    {
        var opts = new SiteTemplateOptions();
        Assert.True(opts.CaptureLibraries);
        Assert.True(opts.CaptureFolders);
        Assert.True(opts.CapturePermissionGroups);
        Assert.True(opts.CaptureLogo);
        Assert.True(opts.CaptureSettings);
    }

    [Fact(Skip = "Requires live SharePoint tenant")]
    public async Task CaptureTemplateAsync_CapturesLibrariesAndFolders()
    {
        await Task.CompletedTask;
    }

    [Fact(Skip = "Requires live SharePoint admin context")]
    public async Task ApplyTemplateAsync_CreatesTeamSiteWithStructure()
    {
        await Task.CompletedTask;
    }
}
