Merge remote-tracking branch 'origin/7.3.0' into dev-v8
Conflicts: src/Umbraco.Core/Services/DomainService.cs src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs src/Umbraco.Web/umbraco.presentation/NotFoundHandlers.cs
This commit is contained in:
@@ -8,6 +8,7 @@ using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
@@ -207,6 +208,68 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Exists()
|
||||
{
|
||||
var provider = new PetaPocoUnitOfWorkProvider(Logger);
|
||||
var unitOfWork = provider.GetUnitOfWork();
|
||||
|
||||
ContentType ct;
|
||||
var contentId = CreateTestData("en-AU", out ct);
|
||||
|
||||
ContentRepository contentRepo;
|
||||
LanguageRepository langRepo;
|
||||
ContentTypeRepository contentTypeRepo;
|
||||
|
||||
using (var repo = CreateRepository(unitOfWork, out contentTypeRepo, out contentRepo, out langRepo))
|
||||
{
|
||||
var lang = langRepo.GetByIsoCode("en-AU");
|
||||
var content = contentRepo.Get(contentId);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var domain = (IDomain)new UmbracoDomain("test" + i + ".com") { RootContent = content, Language = lang };
|
||||
repo.AddOrUpdate(domain);
|
||||
unitOfWork.Commit();
|
||||
}
|
||||
|
||||
var found = repo.Exists("test1.com");
|
||||
|
||||
Assert.IsTrue(found);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Get_By_Name()
|
||||
{
|
||||
var provider = new PetaPocoUnitOfWorkProvider(Logger);
|
||||
var unitOfWork = provider.GetUnitOfWork();
|
||||
|
||||
ContentType ct;
|
||||
var contentId = CreateTestData("en-AU", out ct);
|
||||
|
||||
ContentRepository contentRepo;
|
||||
LanguageRepository langRepo;
|
||||
ContentTypeRepository contentTypeRepo;
|
||||
|
||||
using (var repo = CreateRepository(unitOfWork, out contentTypeRepo, out contentRepo, out langRepo))
|
||||
{
|
||||
var lang = langRepo.GetByIsoCode("en-AU");
|
||||
var content = contentRepo.Get(contentId);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var domain = (IDomain)new UmbracoDomain("test" + i + ".com") { RootContent = content, Language = lang };
|
||||
repo.AddOrUpdate(domain);
|
||||
unitOfWork.Commit();
|
||||
}
|
||||
|
||||
var found = repo.GetByName("test1.com");
|
||||
|
||||
Assert.IsNotNull(found);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Get_All()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user