Files
Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Mappers/DictionaryTranslationMapperTest.cs
Kenn Jacobsen 8caee5297b Use ISO codes instead of language IDs for fallback languages and translations (#13751)
* Use language ISO code for language fallback instead of language ID

* Remove language and language ID from dictionary item and dictionary item translation

* ADd unit test for dictionary item translation value extension

* Make the internal service implementations sealed

* Rename translation ISO code to be more explicit in its origin (Language)

* Add breaking changes suppression

* Handle save of invalid fallback iso code

* Fixed test

* Only allow non-UserCustomCulture's

* Fixed and added tests

* Rename ISO code validation method

* Fix language telemetry test (create Swedish with the correct ISO code)

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-01 09:37:37 +01:00

35 lines
939 B
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using NUnit.Framework;
using Umbraco.Cms.Infrastructure.Persistence.Mappers;
using Umbraco.Cms.Tests.UnitTests.TestHelpers;
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Infrastructure.Persistence.Mappers;
[TestFixture]
public class DictionaryTranslationMapperTest
{
[Test]
public void Can_Map_Key_Property()
{
// Act
var column =
new DictionaryTranslationMapper(TestHelper.GetMockSqlContext(), TestHelper.CreateMaps()).Map("Key");
// Assert
Assert.That(column, Is.EqualTo("[cmsLanguageText].[UniqueId]"));
}
[Test]
public void Can_Map_Value_Property()
{
// Act
var column =
new DictionaryTranslationMapper(TestHelper.GetMockSqlContext(), TestHelper.CreateMaps()).Map("Value");
// Assert
Assert.That(column, Is.EqualTo("[cmsLanguageText].[value]"));
}
}