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

namespace SharepointToolbox.Tests.Services;

public class FileTransferServiceTests
{
    [Fact]
    public void FileTransferService_Implements_IFileTransferService()
    {
        var service = new FileTransferService();
        Assert.IsAssignableFrom<IFileTransferService>(service);
    }

    [Fact]
    public void TransferJob_DefaultValues_AreCorrect()
    {
        var job = new TransferJob();
        Assert.Equal(TransferMode.Copy, job.Mode);
        Assert.Equal(ConflictPolicy.Skip, job.ConflictPolicy);
    }

    [Fact]
    public void ConflictPolicy_HasAllValues()
    {
        Assert.Equal(3, Enum.GetValues<ConflictPolicy>().Length);
        Assert.Contains(ConflictPolicy.Skip, Enum.GetValues<ConflictPolicy>());
        Assert.Contains(ConflictPolicy.Overwrite, Enum.GetValues<ConflictPolicy>());
        Assert.Contains(ConflictPolicy.Rename, Enum.GetValues<ConflictPolicy>());
    }

    [Fact]
    public void TransferMode_HasAllValues()
    {
        Assert.Equal(2, Enum.GetValues<TransferMode>().Length);
        Assert.Contains(TransferMode.Copy, Enum.GetValues<TransferMode>());
        Assert.Contains(TransferMode.Move, Enum.GetValues<TransferMode>());
    }

    [Fact(Skip = "Requires live SharePoint tenant")]
    public async Task TransferAsync_CopyMode_CopiesFiles()
    {
        // Integration test — needs real ClientContext
    }

    [Fact(Skip = "Requires live SharePoint tenant")]
    public async Task TransferAsync_MoveMode_DeletesSourceAfterCopy()
    {
        // Integration test — needs real ClientContext
    }

    [Fact(Skip = "Requires live SharePoint tenant")]
    public async Task TransferAsync_SkipConflict_DoesNotOverwrite()
    {
        // Integration test — needs real ClientContext
    }
}
