示例#1
0
        public void SetupContext()
        {
            var matcher = new RegexMatcher("^Some fake method name", typeof(RegexTestContext).GetMethod("MethodWithReturnValue"));

            TestText  = "Some fake method name";
            TestMatch = matcher.GetMatch(TestText);
        }
示例#2
0
        public void SetupContext()
        {
            var matcher = new RegexMatcher("^Some fake method name (.+)",
                                           typeof(RegexTestContext).GetMethod("MethodWithParams"));

            TestText  = "Some fake method name and some other text";
            TestMatch = matcher.GetMatch(TestText);
        }
示例#3
0
        public void No_partial_matching_on_void_methods()
        {
            var Matcher = new RegexMatcher("^Some fake method name", typeof(RegexTestContext).GetMethod("VoidMethod"));

            Matcher.GetMatch("Some fake method name blah blah blah").ShouldBeNull();
        }
示例#4
0
        public void SetupContext()
        {
            var matcher = new RegexMatcher("^Some fake method name", null);

            TestMatch = matcher.GetMatch("this does not match");
        }
示例#5
0
        public void can_partially_match_on_fields()
        {
            var Matcher = new RegexMatcher("^Foo Bar", typeof(RegexTestContext).GetField("SomeField"));

            Matcher.GetMatch("Foo Bar Baz").ShouldBeOfType <PartialMatch>();
        }
示例#6
0
        public void can_partially_match_on_properties()
        {
            var Matcher = new RegexMatcher("^Foo Bar", typeof(RegexTestContext).GetProperty("SomeProperty"));

            Matcher.GetMatch("Foo Bar Baz").ShouldBeOfType <PartialMatch>();
        }