예제 #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());
        }
예제 #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);
        }