public void LoadFromAssembly_Source1_Titles() { var set = new ResourceSet(); set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1"); var localizer = set.GetLocalizer(); string value; value = localizer.Localize("Title1_Key1UnderT1"); value.ShouldEqual("This should should be prefixed with the titles' key."); value = localizer.Localize("Title1_Title2_Key1UnderT2"); value.ShouldEqual("This should should be prefixed with both titles' key."); value = localizer.Localize("SecondTitle1_Key2UnderT1"); value.ShouldEqual("This should should be prefixed with the titles' key."); value = localizer.Localize("SecondTitle1_SecondTitle2_Key2UnderT2"); value.ShouldEqual("This should should be prefixed with both titles' key."); value = localizer.Localize("SecondTitle1_ThirdTitle2_Key3UnderT2"); value.ShouldEqual("This should should be prefixed with both titles' key."); value = localizer.Localize("Key1AfterTitles"); value.ShouldEqual("This should not be prefixed."); value = localizer.Localize("ThirdTitle1_Key4UnderT1"); value.ShouldEqual("This should should be prefixed with the titles' key."); value = localizer.Localize("ThirdTitle1_FourthTitle2_Key4UnderT2"); value.ShouldEqual("This should should be prefixed with both titles' key."); }
public void LoadFromAssembly_Source1_MultiLineBackslashed2() { var set = new ResourceSet(); set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1"); var localizer = set.GetLocalizer(); var value = localizer.Localize("MultiLineBs2"); value.ShouldEqual(@"This is the first line. And here is the second and last one."); }
public void LoadFromAssembly_Source1_2DoubleQuoted2() { var set = new ResourceSet(); set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1"); var localizer = set.GetLocalizer(); var value = localizer.Localize("MultiLine2DQ2"); value.ShouldEqual("This is the first line \r\nAnd here is the sec\"ond and last one."); }
public void LoadFromAssembly_Source1_3DoubleQuoted1() { var set = new ResourceSet(); set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1"); var localizer = set.GetLocalizer(); var value = localizer.Localize("MultiLine3DQ1"); value.ShouldEqual(@"This is the first li""ne and la""""st one."); }
public void LoadFromAssembly_Source1_LocalizerDefault() { var set = new ResourceSet(); set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1"); var localizer = set.GetLocalizer(); var value = localizer.Localize("Key1"); value.ShouldEqual("Value1 en-US"); value = localizer.Localize("Key2"); value.ShouldEqual("Value in english"); }