Move test projects from src/ to tests/ (#11357)

* Update gitignore

* Move csproj

* Update project references

* Update solutions

* Update build scripts

* Tests used to share editorconfig with projects in src

* Fix broken tests.

* Stop copying around .editorconfig

merged root one with linting

* csharp_style_expression_bodied -> suggestion

* Move StyleCop rulesets to matching directories and update shared build properties

* Remove legacy build files, update NuGet.cofig and solution files

* Restore myget source

* Clean up .gitignore

* Update .gitignore

* Move new test classes to tests after merge

* Gitignore + nuget config

* Move new test

Co-authored-by: Ronald Barendse <ronald@barend.se>
This commit is contained in:
Paul Johnson
2021-10-18 08:14:04 +01:00
committed by GitHub
parent c005673a96
commit 00133e880d
752 changed files with 650 additions and 1844 deletions

View File

@@ -0,0 +1,35 @@
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
using Umbraco.Web.Composing;
namespace Umbraco.Tests.LegacyXmlPublishedCache
{
class PublishedMemberCache : IPublishedMemberCache
{
private readonly PublishedContentTypeCache _contentTypeCache;
private readonly IVariationContextAccessor _variationContextAccessor;
public PublishedMemberCache(PublishedContentTypeCache contentTypeCache, IVariationContextAccessor variationContextAccessor)
{
_contentTypeCache = contentTypeCache;
_variationContextAccessor = variationContextAccessor;
}
public IPublishedContent Get(IMember member)
{
var type = _contentTypeCache.Get(PublishedItemType.Member, member.ContentTypeId);
return new PublishedMember(member, type, _variationContextAccessor)
.CreateModel(Current.PublishedModelFactory);
}
#region Content types
public IPublishedContentType GetContentType(int id) => _contentTypeCache.Get(PublishedItemType.Member, id);
public IPublishedContentType GetContentType(string alias) => _contentTypeCache.Get(PublishedItemType.Member, alias);
#endregion
}
}