GetString() public method

Gets the string from the specified resource file with the current culture.
The is null. The is null. The is null.
public GetString ( ILanguageSource languageSource, string resourceName, CultureInfo cultureInfo ) : string
languageSource ILanguageSource The language source.
resourceName string Name of the resource.
cultureInfo System.Globalization.CultureInfo The culture information.
return string
Esempio n. 1
0
            public void ReturnsStringForMvvmAssembly()
            {
                var languageService = new LanguageService();

                Assert.AreEqual("Warning", languageService.GetString("WarningTitle"));
                Assert.AreEqual("Warning", languageService.GetString("WarningTitle"));
            }
Esempio n. 2
0
            public void ReturnsNullForNonExistingResource()
            {
                var languageService = new LanguageService();

                Assert.AreEqual(null, languageService.GetString("NonExistingResourceName"));
            }
Esempio n. 3
0
            public void ThrowsArgumentExceptionForNullResourceName()
            {
                var languageService = new LanguageService();

                ExceptionTester.CallMethodAndExpectException<ArgumentException>(() => languageService.GetString(null));
            }
Esempio n. 4
0
            public void ReturnsStringForCoreAssembly()
            {
                var languageService = new LanguageService();

                Assert.AreEqual("{0} has the following warnings:", languageService.GetString("WarningsFound"));
            }