Added logging

This commit is contained in:
Nikolaj Geisle
2021-10-14 13:30:22 +02:00
parent 4c616dc71d
commit 7379387b2e
3 changed files with 19 additions and 6 deletions

View File

@@ -412,7 +412,6 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers
[Test]
public async Task PostSave_Validates_Domains_Exist()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
ILocalizationService localizationService = GetRequiredService<ILocalizationService>();
localizationService.Save(new LanguageBuilder()
.WithCultureInfo("da-DK")
@@ -445,17 +444,21 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers
body = body.TrimStart(AngularJsonMediaTypeFormatter.XsrfPrefix);
ContentItemDisplay display = JsonConvert.DeserializeObject<ContentItemDisplay>(body);
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
ILocalizedTextService localizedTextService = GetRequiredService<ILocalizedTextService>();
var expectedMessage = localizedTextService.Localize("speechBubbles", "publishWithNoDomains", new []{"en-US"});
Assert.Multiple(() =>
{
Assert.IsNotNull(display);
Assert.AreEqual(1, display.Notifications.Count(x => x.NotificationType == NotificationStyle.Warning));
Assert.AreEqual(expectedMessage, display.Notifications.FirstOrDefault(x => x.NotificationType == NotificationStyle.Warning)?.Message);
});
}
[Test]
public async Task PostSave_Validates_All_Cultures_Has_Domains()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
var enString = "en-US";
var dkString = "da-DK";
@@ -504,11 +507,14 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.Controllers
body = body.TrimStart(AngularJsonMediaTypeFormatter.XsrfPrefix);
ContentItemDisplay display = JsonConvert.DeserializeObject<ContentItemDisplay>(body);
ILocalizedTextService localizedTextService = GetRequiredService<ILocalizedTextService>();
var expectedMessage = localizedTextService.Localize("speechBubbles", "publishWithMissingDomain", new []{"en-US"});
Assert.Multiple(() =>
{
Assert.NotNull(display);
Assert.AreEqual(1, display.Notifications.Count(x => x.NotificationType == NotificationStyle.Warning));
Assert.AreEqual(expectedMessage, display.Notifications.FirstOrDefault(x => x.NotificationType == NotificationStyle.Warning)?.Message);
});
}