Exemple #1
0
        public void TestPartialMatch()
        {
            //SETUP
            var props = new List <PropertyInfo> {
                _myIntProp, _myStringProp
            };
            var method = typeof(TestParametersMatch).GetMethod(nameof(NotMatch));

            //ATTEMPT
            var match = new ParametersMatch(method.GetParameters(), props, DefaultNameMatcher.MatchCamelAndPascalName);

            //VERIFY
            match.Score.ShouldEqual(0.65);
        }
Exemple #2
0
        public void TestMatchGood(string propName, string methodName, double expectedScore)
        {
            //SETUP
            var prop   = typeof(TestParametersMatch).GetProperty(propName);
            var method = typeof(TestParametersMatch).GetMethod(methodName);

            //ATTEMPT
            var match = new ParametersMatch(method.GetParameters(), new List <PropertyInfo> {
                prop
            }, DefaultNameMatcher.MatchCamelAndPascalName);

            //VERIFY
            match.Score.ShouldEqual(expectedScore);
        }