Reflect changed namespaces in Builder and fix unit tests

This commit is contained in:
Mole
2021-02-09 15:39:00 +01:00
parent 16597469e6
commit 24a56882cd
4 changed files with 8 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
"Umbraco.Core.Models.PublishedContent",
"Umbraco.Web.PublishedCache",
"Umbraco.ModelsBuilder.Embedded",
"Umbraco.Core"
"Umbraco.Cms.Core"
};
/// <summary>

View File

@@ -194,7 +194,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
sb.Append("\t\tprivate IPublishedValueFallback _publishedValueFallback;");
// write the ctor
sb.AppendFormat("\n\n\t\t// ctor\n\t\tpublic {0}(IPublished{1} content, IPublishedValueFallback publishedValueFallback)\n\t\t\t: base(content)\n\t\t{{\n\t\t\t_publishedValueFallback = publishedValueFallback; \n\t\t}}\n\n",
sb.AppendFormat("\n\n\t\t// ctor\n\t\tpublic {0}(IPublished{1} content, IPublishedValueFallback publishedValueFallback)\n\t\t\t: base(content)\n\t\t{{\n\t\t\t_publishedValueFallback = publishedValueFallback;\n\t\t}}\n\n",
type.ClrName, type.IsElement ? "Element" : "Content");
// write the properties

View File

@@ -278,14 +278,14 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.CoreThings
// unless we want to know
Assert.IsFalse(UdiParser.TryParse("umb://whatever/1234", true, out udi));
Assert.AreEqual(Constants.UdiEntityType.Unknown, udi.EntityType);
Assert.AreEqual("Umbraco.Core.UnknownTypeUdi", udi.GetType().FullName);
Assert.AreEqual("Umbraco.Cms.Core.UnknownTypeUdi", udi.GetType().FullName);
UdiParser.ResetUdiTypes();
// not known
Assert.IsFalse(UdiParser.TryParse("umb://foo/A87F65C8D6B94E868F6949BA92C93045", true, out udi));
Assert.AreEqual(Constants.UdiEntityType.Unknown, udi.EntityType);
Assert.AreEqual("Umbraco.Core.UnknownTypeUdi", udi.GetType().FullName);
Assert.AreEqual("Umbraco.Cms.Core.UnknownTypeUdi", udi.GetType().FullName);
// scanned
UdiParserServiceConnectors.RegisterServiceConnector<FooConnector>(); // this is the equivalent of scanning but we'll just manually register this one

View File

@@ -62,7 +62,7 @@ using System.Linq.Expressions;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.PublishedCache;
using Umbraco.ModelsBuilder.Embedded;
using Umbraco.Core;
using Umbraco.Cms.Core;
namespace Umbraco.Web.PublishedModels
{
@@ -167,7 +167,7 @@ using System.Linq.Expressions;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.PublishedCache;
using Umbraco.ModelsBuilder.Embedded;
using Umbraco.Core;
using Umbraco.Cms.Core;
namespace Umbraco.Web.PublishedModels
{
@@ -258,9 +258,9 @@ namespace Umbraco.Web.PublishedModels
Console.WriteLine(gen);
Assert.IsTrue(gen.Contains(" global::Umbraco.Core.Models.PublishedContent.IPublishedContent Prop1"));
Assert.IsTrue(gen.Contains(" global::Umbraco.Cms.Core.Models.PublishedContent.IPublishedContent Prop1"));
Assert.IsTrue(gen.Contains(" global::System.Text.StringBuilder Prop2"));
Assert.IsTrue(gen.Contains(" global::Umbraco.Core.Exceptions.BootFailedException Prop3"));
Assert.IsTrue(gen.Contains(" global::Umbraco.Cms.Core.Exceptions.BootFailedException Prop3"));
}
[TestCase("int", typeof(int))]