Esempio n. 1
0
        public void ConvertStringToRegex()
        {
            var rString = ".+";

            var converter = new RegexConverter();

            var result = converter.ConvertFrom(rString);

            var rResult = result as Regex;

            Assert.NotNull(rResult);
            Assert.Equal(rString, rResult.ToString());
        }
Esempio n. 2
0
        public void ConvertRegexToString()
        {

            var rString = ".+";
            var regex = new Regex(rString);


            var converter = new RegexConverter();

            var result = converter.ConvertTo(regex, typeof (string));
            var sResult = result as string;

            Assert.False(string.IsNullOrEmpty(sResult));
            Assert.Equal(rString, sResult);
        }