Example #1
0
        public void ShouldReturnMethodNames()
        {
            List <MethodInfo> methods = new List <MethodInfo>();

            methods.AddRange(typeof(MockProxy).GetMethods());

            List <string> methodNames = MethodBehaviorHelper.GetMethodNames(methods);

            Assert.IsTrue(methodNames.Contains("HelloWorld"));
            Assert.IsTrue(methodNames.Contains("Foo"));
        }
Example #2
0
        public override bool OnBeginRecipe(object currentValue, out object newValue)
        {
            newValue = null;
            if (currentValue == null)
            {
                CodeClass currentDSAClass = ExpressionEvaluationHelper.EvaluateExpression((IDictionaryService)GetService(typeof(IDictionaryService)),
                                                                                          currentDSAClassExpression) as CodeClass;
                Type proxyType = ExpressionEvaluationHelper.EvaluateExpression((IDictionaryService)GetService(typeof(IDictionaryService)),
                                                                               proxyTypeExpression) as Type;

                if (currentDSAClass != null && proxyType != null)
                {
                    Type dsaType = DteConverter.ToType(currentDSAClass);
                    if (dsaType != null)
                    {
                        newValue = MethodBehaviorHelper.GetMethodNames(MethodBehaviorHelper.GetAgentMethods(dsaType, proxyType));
                    }
                }
            }
            return(currentValue != newValue);
        }