Esempio n. 1
0
        public void Convert_Falls_Back_To_Formats_Value_With_Untranslated_MsgId_Stripping_Context()
        {
            var target = new GettextStringFormatConverter("CTX|MSGID {0}");
            var value  = "SOME VALUE";

            GettextStringFormatConverter.Localizer = null;

            Assert.Equal("MSGID SOME VALUE", target.Convert(value, null, null, null));
        }
Esempio n. 2
0
        public void Convert_Formats_Value_With_Translated_MsgId_Using_Translation_Context()
        {
            var target = new GettextStringFormatConverter("CTX|MSGID {0}");

            var value = "SOME VALUE";

            GettextStringFormatConverter.Localizer.Catalog.GetParticularString(Arg.Is("CTX"), Arg.Is("MSGID {0}"), Arg.Is(value))
            .Returns("FORMATTED TRANSLATION");

            Assert.Equal("FORMATTED TRANSLATION", target.Convert(value, null, null, null));
        }