This commit is contained in:
Elitsa Marinovska
2021-11-03 10:23:50 +01:00
parent a25183a063
commit 236bf88143
14 changed files with 46 additions and 42 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>
@@ -29,7 +30,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
[Test]
public void PerformContentVersionCleanup_WithNoKeepPeriods_DeletesEverythingExceptActive()
{
// For reference currently has
// For reference, Our currently has
// 5000 Documents
// With 200K Versions
// With 11M Property data
@@ -38,12 +39,12 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
FileService.SaveTemplate(template);
ContentType contentTypeA = ContentTypeBuilder.CreateSimpleContentType("contentTypeA", "contentTypeA", defaultTemplateId: template.Id);
// Kill all historic
contentTypeA.HistoryCleanup.PreventCleanup = false;
contentTypeA.HistoryCleanup.KeepAllVersionsNewerThanDays = 0;
contentTypeA.HistoryCleanup.KeepLatestVersionPerDayForDays = 0;
ContentTypeService.Save(contentTypeA);
Content content = ContentBuilder.CreateSimpleContent(contentTypeA);

View File

@@ -139,7 +139,6 @@ namespace Umbraco.Tests.Scheduling
mainDom.Setup(x => x.IsMainDom).Returns(true);
serverRoleAccessor.Setup(x => x.CurrentServerRole).Returns(ServerRole.SchedulingPublisher);
await sut.PerformExecuteAsync(null);
cleanupService.Verify(x => x.PerformContentVersionCleanup(It.IsAny<DateTime>()), Times.Once);

View File

@@ -261,6 +261,5 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(6, results.Single(x => x.ContentTypeId == 2).VersionId);
});
}
}
}

View File

@@ -503,8 +503,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers
mockShortStringHelper,
globalSettings,
new Mock<IHostingEnvironment>().Object,
new Mock<IOptionsMonitor<ContentSettings>>().Object
)
new Mock<IOptionsMonitor<ContentSettings>>().Object)
});
var scopeProvider = Mock.Of<IScopeProvider>(x => x.CreateScope(
It.IsAny<IsolationLevel>(),