Files
Umbraco-CMS/tests/Umbraco.Tests/LegacyXmlPublishedCache/PublishedSnapshot.cs
Paul Johnson 00133e880d 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>
2021-10-18 08:14:04 +01:00

64 lines
1.7 KiB
C#

using System;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.PublishedCache;
namespace Umbraco.Tests.LegacyXmlPublishedCache
{
/// <summary>
/// Implements a published snapshot.
/// </summary>
class PublishedSnapshot : IPublishedSnapshot
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedSnapshot"/> class with a content cache
/// and a media cache.
/// </summary>
public PublishedSnapshot(
PublishedContentCache contentCache,
PublishedMediaCache mediaCache,
PublishedMemberCache memberCache,
DomainCache domainCache)
{
Content = contentCache;
Media = mediaCache;
Members = memberCache;
Domains = domainCache;
}
/// <inheritdoc />
public IPublishedContentCache Content { get; }
/// <inheritdoc />
public IPublishedMediaCache Media { get; }
/// <inheritdoc />
public IPublishedMemberCache Members { get; }
/// <inheritdoc />
public IDomainCache Domains { get; }
/// <inheritdoc />
public IAppCache SnapshotCache => null;
/// <inheritdoc />
public IAppCache ElementsCache => null;
/// <inheritdoc />
public IDisposable ForcedPreview(bool preview, Action<bool> callback = null)
{
// the XML cache does not support forcing preview, really, so, just pretend...
return new ForcedPreviewObject();
}
private class ForcedPreviewObject : DisposableObjectSlim
{
protected override void DisposeResources()
{ }
}
public void Dispose()
{ }
}
}