public void TestTextDecorationConverter()
        {
            var             converter = new TextDecorationConverter();
            TextDecorations both      = TextDecorations.Strikethrough;

            both |= TextDecorations.Underline;
            Assert.True(converter.CanConvertFrom(typeof(string)));
            Assert.AreEqual(TextDecorations.Strikethrough, converter.ConvertFromInvariantString("strikethrough"));
            Assert.AreEqual(TextDecorations.Underline, converter.ConvertFromInvariantString("underline"));
            Assert.AreEqual(TextDecorations.Strikethrough, converter.ConvertFromInvariantString("line-through"));
            Assert.AreEqual(TextDecorations.None, converter.ConvertFromInvariantString("none"));
            Assert.AreEqual(both, converter.ConvertFromInvariantString("strikethrough underline"));
            Assert.AreEqual(both, converter.ConvertFromInvariantString("underline strikethrough"));
            Assert.AreEqual(both, converter.ConvertFromInvariantString("underline line-through"));
            Assert.AreEqual(both, converter.ConvertFromInvariantString("line-through underline"));
        }
Exemple #2
0
        public void TestTextDecorationConverter(string input, TextDecorations expected)
        {
            var converter = new TextDecorationConverter();

            Assert.AreEqual(converter.ConvertFromInvariantString(input), expected);
        }