feat(04-06): implement TemplateService and FolderStructureService
- FolderStructureService.CreateFoldersAsync creates folder hierarchy from CSV rows using BulkOperationRunner - FolderStructureService.BuildUniquePaths deduplicates and sorts paths parent-first by slash depth - TemplateService already committed; verified compilation and interface compliance - FolderStructureServiceTests: 4 unit tests pass (BuildUniquePaths edge cases, deduplication, empty levels, BuildPath) + 1 skip - TemplateServiceTests: 3 unit tests pass (interface impl, SiteTemplate defaults, SiteTemplateOptions defaults) + 2 skip
This commit is contained in:
49
SharepointToolbox.Tests/Services/TemplateServiceTests.cs
Normal file
49
SharepointToolbox.Tests/Services/TemplateServiceTests.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user