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

namespace SharepointToolbox.Tests.Services;

public class BulkSiteServiceTests
{
    [Fact]
    public void BulkSiteService_Implements_IBulkSiteService()
    {
        Assert.True(typeof(IBulkSiteService).IsAssignableFrom(typeof(BulkSiteService)));
    }

    [Fact]
    public void BulkSiteRow_DefaultValues()
    {
        var row = new BulkSiteRow();
        Assert.Equal(string.Empty, row.Name);
        Assert.Equal(string.Empty, row.Alias);
        Assert.Equal(string.Empty, row.Type);
        Assert.Equal(string.Empty, row.Template);
        Assert.Equal(string.Empty, row.Owners);
        Assert.Equal(string.Empty, row.Members);
    }

    [Fact]
    public void BulkSiteRow_ParsesCommaSeparatedEmails()
    {
        var row = new BulkSiteRow
        {
            Name = "Test Site",
            Alias = "test-site",
            Type = "Team",
            Owners = "admin@test.com, user@test.com",
            Members = "member1@test.com,member2@test.com"
        };

        Assert.Equal("Test Site", row.Name);
        Assert.Contains("admin@test.com", row.Owners);
    }

    [Fact(Skip = "Requires live SharePoint admin context")]
    public async Task CreateSitesAsync_TeamSite_CreatesWithOwners()
    {
    }

    [Fact(Skip = "Requires live SharePoint admin context")]
    public async Task CreateSitesAsync_CommunicationSite_CreatesWithUrl()
    {
    }

    [Fact(Skip = "Requires live SharePoint admin context")]
    public async Task CreateSitesAsync_MixedTypes_HandlesEachCorrectly()
    {
    }
}
