Fix some tests

This commit is contained in:
Stephan
2018-05-04 18:13:06 +02:00
parent b35d28c568
commit 71ed99f080
4 changed files with 8 additions and 5 deletions

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -76,7 +76,7 @@ namespace Umbraco.Tests.Integration
{
base.TearDown();
_h1.Unbind();
_h1?.Unbind();
// clear ALL events

View File

@@ -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));