public void Create_by_ResourceSource_Key_not_Found_Test() { using var factory = new I18nTextStringLocalizerFactory(new I18nTextRepository(null)); var localizer = factory.Create(typeof(Here.MyNameSpace.Pages.Index)); var lstr = localizer["Greeting"]; lstr.Name.Is("Greeting"); lstr.Value.Is("Greeting"); lstr.ResourceNotFound.IsTrue(); lstr.SearchedLocation.Is("Here.MyNameSpace.I18nText.Pages.Index"); }
public void Create_by_ResourceSource_Test() { using var factory = new I18nTextStringLocalizerFactory(new I18nTextRepository(null)); var localizer = factory.Create(typeof(Here.MyNameSpace.Pages.Index)); var lstr = localizer["HelloWorld"]; lstr.Name.Is("HelloWorld"); lstr.Value.Is("Hello, World!"); lstr.ResourceNotFound.IsFalse(); lstr.SearchedLocation.Is("Here.MyNameSpace.I18nText.Pages.Index"); }
public void Create_by_ResourceSource_TextTable_not_Found_Test() { using var factory = new I18nTextStringLocalizerFactory(new I18nTextRepository(null)); var localizer = factory.Create(typeof(Here.MyNameSpace.Pages.Counter)); var lstr = localizer["Season"]; lstr.Name.Is("Season"); lstr.Value.Is("Season"); lstr.ResourceNotFound.IsTrue(); lstr.SearchedLocation.Is("Here.MyNameSpace.Pages.Counter"); }
public void Create_by_baseName_and_location_location_not_Found_Test() { var location = this.GetType().Assembly.GetName().Name; using var factory = new I18nTextStringLocalizerFactory(new I18nTextRepository(null)); var localizer = factory.Create(baseName: $"{location}.Pages.Index", "NotFoundAssembly"); var lstr = localizer["HelloWorld"]; lstr.Name.Is("HelloWorld"); lstr.Value.Is("HelloWorld"); lstr.ResourceNotFound.IsTrue(); lstr.SearchedLocation.Is($"{location}.Pages.Index"); }