public void HtmlLocalizer_GetString_ReturnsLocalizedString()
        {
            // Arrange
            var stringLocalizer = new TestStringLocalizer();

            var htmlLocalizer = new HtmlLocalizer(stringLocalizer);

            // Act
            var actualLocalizedString = htmlLocalizer.GetString("John");

            // Assert
            Assert.Equal("Hello John", actualLocalizedString.Value);
        }
Esempio n. 2
0
        public void HtmlLocalizer_GetString_ReturnsLocalizedString()
        {
            // Arrange
            var stringLocalizer = new TestStringLocalizer();

            var htmlLocalizer = new HtmlLocalizer(stringLocalizer);

            // Act
            var actualLocalizedString = htmlLocalizer.GetString("John");

            // Assert
            Assert.Equal("Hello John", actualLocalizedString.Value);
        }
 /// <summary>
 /// Gets localized string for given key name and current language with formatting strings.
 /// </summary>
 protected string L(string name, params object[] args) => HtmlLocalizer.GetString(name, args);
 /// <summary>
 /// Gets localized string for given key name and current language.
 /// </summary>
 protected string L(string name) => HtmlLocalizer.GetString(name);