* starts cleaning up old test project, removing ones we'll never convert, moves new test to where it should be. * Makes ContentNodeKit immutable properties, moves first nucache tests over * Gets the Nucache unit tests working and refactors a bit to use builder pattern for models. * Migrates first xml based cache test to use nucache. * Migrates a bunch more * Migrates remaining tests for PublishedContentTests * Moves PublishedRouterTests * Moves PublishedContentExtensionTests * Moves more tests. * committing wip * committing wip * Gets PublishedContentLanguageVariantTests converted and working. * Fixes DataTable ext method and moves PublishedContentDataTableTests * Moves PublishedMediaTests * wip - moving EntityXmlSerializerTests * Moves more tests * moves more tests * moves more tests * Move another test * Moves more tests * Fix test * move another test * Moves more tests * Moves more tests * Moves more tests * wip before merge * More tests * More tests * More tests * More tests * More tests * More tests * Cleanup and moving classes. * Remove unused code * Fixed failing tests, due to new null checks, that did not exist in v8 * Avoid breaking changes * Unbreak more things, even that it the old solution was crazy.. * Fixed bug where ordering of stream readings was changed.. * cleanup Co-authored-by: Bjarke Berg <mail@bergmania.dk>
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
// Copyright (c) Umbraco.
|
|
// See LICENSE for more details.
|
|
|
|
using System.Collections.Generic;
|
|
using Moq;
|
|
using Umbraco.Cms.Core.Models.PublishedContent;
|
|
using Umbraco.Extensions;
|
|
|
|
namespace Umbraco.Cms.Tests.Common.Published
|
|
{
|
|
|
|
public class PublishedSnapshotTestObjects
|
|
{
|
|
[PublishedModel("element1")]
|
|
public class TestElementModel1 : PublishedElementModel
|
|
{
|
|
public TestElementModel1(IPublishedElement content, IPublishedValueFallback fallback)
|
|
: base(content, fallback)
|
|
{
|
|
}
|
|
|
|
public string Prop1 => this.Value<string>(Mock.Of<IPublishedValueFallback>(), "prop1");
|
|
}
|
|
|
|
[PublishedModel("element2")]
|
|
public class TestElementModel2 : PublishedElementModel
|
|
{
|
|
public TestElementModel2(IPublishedElement content, IPublishedValueFallback fallback)
|
|
: base(content, fallback)
|
|
{
|
|
}
|
|
|
|
public IEnumerable<TestContentModel1> Prop2 => this.Value<IEnumerable<TestContentModel1>>(Mock.Of<IPublishedValueFallback>(), "prop2");
|
|
}
|
|
|
|
[PublishedModel("content1")]
|
|
public class TestContentModel1 : PublishedContentModel
|
|
{
|
|
public TestContentModel1(IPublishedContent content, IPublishedValueFallback fallback)
|
|
: base(content, fallback)
|
|
{
|
|
}
|
|
|
|
public string Prop1 => this.Value<string>(Mock.Of<IPublishedValueFallback>(), "prop1");
|
|
}
|
|
|
|
[PublishedModel("content2")]
|
|
public class TestContentModel2 : PublishedContentModel
|
|
{
|
|
public TestContentModel2(IPublishedContent content, IPublishedValueFallback fallback)
|
|
: base(content, fallback)
|
|
{
|
|
}
|
|
|
|
public IEnumerable<TestContentModel1> Prop2 => this.Value<IEnumerable<TestContentModel1>>(Mock.Of<IPublishedValueFallback>(), "prop2");
|
|
}
|
|
}
|
|
}
|