public void TestGetSupportedOperationsDisplayItemsWithBool(string cultureName, string search, string expected)
        {
            if (!string.IsNullOrEmpty(cultureName))
            {
                var culture = CultureInfo.CreateSpecificCulture(cultureName);
                Thread.CurrentThread.CurrentCulture   = culture;
                Thread.CurrentThread.CurrentUICulture = culture;

                I18NHelper.LoadLanguage(culture.TwoLetterISOLanguageName);
            }
            else
            {
                I18NHelper.LoadDefaultLanguage();
            }


            var items = OperationHelper.GetSupportedOperationsDisplayItemsLocalized(typeof(string));

            Assert.IsNotNull(items);
            Assert.IsTrue(items.Length > 0);

            // Act
            var result = items.FirstOrDefault(x => x.Id == search);


            // Assert
            Assert.IsNotNull(result);

            Assert.AreEqual(expected, result.Name);
        }
Пример #2
0
        public void TestLoadLanguage()
        {
            // Arrange
            var count = I18NHelper.Languages.Count;

            Assert.IsTrue(count > 0);

            // Act
            I18NHelper.LoadLanguage("DE");

            // Assert
            Assert.IsTrue(I18NHelper.Count > 0);
        }
Пример #3
0
        public void TestGetString()
        {
            // Arrange
            var count = I18NHelper.Languages.Count;

            Assert.IsTrue(count > 0);

            I18NHelper.LoadLanguage("DE");
            Assert.IsTrue(I18NHelper.Count > 0);

            // Act
            var result = I18NHelper.GetString("IsNotNullNorWhiteSpace");

            // Assert
            Assert.IsNotNull(result);
            Assert.IsFalse(result.Contains("$$"));
        }