Cleanup and fixed tests

This commit is contained in:
Bjarke Berg
2021-11-02 09:18:15 +01:00
parent 926c74dcba
commit b7d5fd4b26
20 changed files with 183 additions and 91 deletions

View File

@@ -20,6 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
public IContentTypeService ContentTypeService => GetRequiredService<IContentTypeService>();
public IContentService ContentService => GetRequiredService<IContentService>();
public IContentVersionService ContentVersionService => GetRequiredService<IContentVersionService>();
/// <remarks>
/// This is covered by the unit tests, but nice to know it deletes on infra.
@@ -33,8 +34,10 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
// With 200K Versions
// With 11M Property data
ContentType contentTypeA = ContentTypeBuilder.CreateSimpleContentType("contentTypeA", "contentTypeA");
FileService.SaveTemplate(contentTypeA.DefaultTemplate);
Template template = TemplateBuilder.CreateTextPageTemplate();
FileService.SaveTemplate(template);
ContentType contentTypeA = ContentTypeBuilder.CreateSimpleContentType("contentTypeA", "contentTypeA", defaultTemplateId: template.Id);
ContentTypeService.Save(contentTypeA);
Content content = ContentBuilder.CreateSimpleContent(contentTypeA);
@@ -53,7 +56,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
// Kill all historic
InsertCleanupPolicy(contentTypeA, 0, 0);
((IContentVersionService)ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));
ContentVersionService.PerformContentVersionCleanup(DateTime.Now.AddHours(1));
Report after = GetReport();