Fix some tests
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Umbraco.Core.Models
|
||||
Id = 0; // no identity
|
||||
VersionId = 0; // no versions
|
||||
|
||||
SetName(culture, name);
|
||||
SetName(name, culture);
|
||||
|
||||
_contentTypeId = contentType.Id;
|
||||
_properties = properties ?? throw new ArgumentNullException(nameof(properties));
|
||||
|
||||
@@ -1163,7 +1163,6 @@ namespace Umbraco.Core
|
||||
public static string ToUrlSegment(this string text, string culture)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentNullOrEmptyException(nameof(text));
|
||||
if (culture == null) throw new ArgumentNullException(nameof(culture));
|
||||
|
||||
return Current.ShortStringHelper.CleanStringForUrlSegment(text, culture);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Tests.Integration
|
||||
{
|
||||
base.TearDown();
|
||||
|
||||
_h1.Unbind();
|
||||
_h1?.Unbind();
|
||||
|
||||
// clear ALL events
|
||||
|
||||
|
||||
@@ -978,7 +978,7 @@ namespace Umbraco.Tests.Services
|
||||
var content = new Content(string.Empty, -1, ServiceContext.ContentTypeService.Get("umbTextpage"));
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<ArgumentException>(() => contentService.Save(content));
|
||||
Assert.Throws<InvalidOperationException>(() => contentService.Save(content));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -2562,7 +2562,11 @@ namespace Umbraco.Tests.Services
|
||||
Assert.AreEqual("name-fr", content2.GetName(langFr.IsoCode));
|
||||
Assert.AreEqual("name-uk", content2.GetName(langUk.IsoCode));
|
||||
|
||||
Assert.IsNull(content2.PublishName); // we haven't published InvariantNeutral
|
||||
// we haven't published InvariantNeutral, but a document cannot be published without an invariant name,
|
||||
// so when we tried and published for the first time above the french culture, the french name was used
|
||||
// to populate the invariant name
|
||||
Assert.AreEqual("name-fr", content2.PublishName);
|
||||
|
||||
Assert.AreEqual("name-fr", content2.GetPublishName(langFr.IsoCode));
|
||||
Assert.AreEqual("name-uk", content2.GetPublishName(langUk.IsoCode));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user