V14: Deleted code marked as obsolete for V14 (#15998)
* Obsoletions related to Delivery API * Fix TypeLoader and TypeFinder tests * Remove obsolete and default implementations of IFileSource and IFileTypeCollection * More Delivery API related obsoletions * VariationContextAccessor related * ValueFactories obsoletion and fix references * ValueSetBuilders obsoletions * ValueConverters obsoletions * Other obsolete ctors and methods * Forgotten VariationContextAccessor obsoletion * More obsoletions * XPath related obsoletions * Revert XmlHelper changes * Delete RenamedRootNavigator and its tests * Fix test * XmlHelper obsoletion * Return null instead of GetXPathValue * Obsolete entire class instead * Remove XPath obsoletions from IPublishedCache * Remove XPath-related if-block that is no longer needed * Change obsolete msg for classes needed for NuCache * Moving classes to NuCache and making them internal * Remove more XPath-related obsoletions * Remove NavigableNavigator and its tests * Cleanup * Remove Xpath references from tests * Revert interface deletion in MediaCache * Using XOR operation Co-authored-by: Nuklon <Nuklon@users.noreply.github.com> --------- Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
187d45860a
commit
9c18cd22e0
@@ -38,7 +38,8 @@ public class TypeFinderTests
|
||||
{
|
||||
var typeFinder = new TypeFinder(
|
||||
Mock.Of<ILogger<TypeFinder>>(),
|
||||
new DefaultUmbracoAssemblyProvider(GetType().Assembly, NullLoggerFactory.Instance));
|
||||
new DefaultUmbracoAssemblyProvider(GetType().Assembly, NullLoggerFactory.Instance),
|
||||
null);
|
||||
var typesFound = typeFinder.FindClassesOfTypeWithAttribute<TestEditor, MyTestAttribute>(_assemblies);
|
||||
Assert.AreEqual(2, typesFound.Count());
|
||||
}
|
||||
|
||||
@@ -20,15 +20,6 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Configuration.Models.Validati
|
||||
Assert.True(result.Succeeded);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_Fail_For_Configuration_With_Invalid_Error404Collection_Due_To_Duplicate_Id()
|
||||
{
|
||||
var validator = new ContentSettingsValidator();
|
||||
ContentSettings options = BuildContentSettings(contentXPath: "/aaa/bbb");
|
||||
ValidateOptionsResult result = validator.Validate("settings", options);
|
||||
Assert.False(result.Succeeded);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_Fail_For_Configuration_With_Invalid_Error404Collection_Due_To_Empty_Culture()
|
||||
{
|
||||
@@ -47,12 +38,12 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Configuration.Models.Validati
|
||||
Assert.False(result.Succeeded);
|
||||
}
|
||||
|
||||
private static ContentSettings BuildContentSettings(string culture = "en-US", string contentXPath = "", string autoFillImagePropertyAlias = "testAlias") =>
|
||||
private static ContentSettings BuildContentSettings(string culture = "en-US", string autoFillImagePropertyAlias = "testAlias") =>
|
||||
new ContentSettings
|
||||
{
|
||||
Error404Collection = new ContentErrorPage[]
|
||||
{
|
||||
new() { Culture = culture, ContentId = 1, ContentXPath = contentXPath },
|
||||
new() { Culture = culture, ContentId = 1 },
|
||||
},
|
||||
Imaging = new ContentImagingSettings
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,123 +0,0 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core.Xml.XPath;
|
||||
using Umbraco.Cms.Tests.Common.TestHelpers;
|
||||
|
||||
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.CoreXml;
|
||||
|
||||
[TestFixture]
|
||||
public class RenamedRootNavigatorTests
|
||||
{
|
||||
[Test]
|
||||
public void StandardNavigator()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<root foo=""bar"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</root>");
|
||||
var nav = doc.CreateNavigator();
|
||||
var xml = nav.OuterXml;
|
||||
Assert.AreEqual(
|
||||
EnsureNativeLineEndings(@"<root foo=""bar"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</root>"),
|
||||
xml);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StandardNavigatorWithNamespace()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<xx:root foo=""bar"" xmlns:xx=""uri"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</xx:root>");
|
||||
var nav = doc.CreateNavigator();
|
||||
var xml = nav.OuterXml;
|
||||
Assert.AreEqual(
|
||||
EnsureNativeLineEndings(@"<xx:root foo=""bar"" xmlns:xx=""uri"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</xx:root>"),
|
||||
xml);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RenamedNavigator()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<root foo=""bar"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</root>");
|
||||
var nav = new RenamedRootNavigator(doc.CreateNavigator(), "test");
|
||||
var xml = nav.OuterXml;
|
||||
Assert.AreEqual(
|
||||
EnsureNativeLineEndings(@"<test foo=""bar"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</test>"),
|
||||
xml);
|
||||
}
|
||||
|
||||
private string EnsureNativeLineEndings(string text)
|
||||
{
|
||||
var useCrLf = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
return useCrLf ? text.CrLf() : text.Lf();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RenamedNavigatorWithNamespace()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<xx:root foo=""bar"" xmlns:xx=""uri"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</xx:root>");
|
||||
var nav = new RenamedRootNavigator(doc.CreateNavigator(), "test");
|
||||
var xml = nav.OuterXml;
|
||||
Assert.AreEqual(
|
||||
EnsureNativeLineEndings(@"<xx:test foo=""bar"" xmlns:xx=""uri"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</xx:test>"),
|
||||
xml);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RenamedNavigatorProperties()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<root foo=""bar"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</root>");
|
||||
var nav = new RenamedRootNavigator(doc.CreateNavigator(), "test");
|
||||
Assert.IsTrue(nav.MoveToFirstChild());
|
||||
Assert.AreEqual(XPathNodeType.Element, nav.NodeType);
|
||||
Assert.AreEqual("test", nav.Name);
|
||||
Assert.AreEqual("test", nav.LocalName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RenamedNavigatorWithNamespaceProperties()
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.LoadXml(@"<xx:root foo=""bar"" xmlns:xx=""uri"">
|
||||
<a></a>
|
||||
<b x=""1""></b>
|
||||
</xx:root>");
|
||||
var nav = new RenamedRootNavigator(doc.CreateNavigator(), "test");
|
||||
Assert.IsTrue(nav.MoveToFirstChild());
|
||||
Assert.AreEqual(XPathNodeType.Element, nav.NodeType);
|
||||
Assert.AreEqual("xx:test", nav.Name);
|
||||
Assert.AreEqual("test", nav.LocalName);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using NUnit.Framework;
|
||||
|
||||
Reference in New Issue
Block a user