Ejemplo n.º 1
0
        public TypedValue Invoke(TypedValue instance, string prefixedMemberName, Tree <Cell> parameters)
        {
            var memberName = prefixedMemberName.Substring(1);
            var member     = RuntimeType.FindDirectInstance(instance.Value, new IdentifierName(memberName), 0);

            return(member != null
                            ? member.Invoke(new object[] {})
                            : TypedValue.MakeInvalid(new MemberMissingException(instance.Type, memberName, 0)));
        }
Ejemplo n.º 2
0
        public TypedValue Invoke(TypedValue instance, string directMemberName, Tree <Cell> parameters)
        {
            string memberName = directMemberName.Substring(DirectPrefix.Length);

            if (directMemberName == SetUpMethod || directMemberName == TearDownMethod)
            {
                RuntimeMember member = RuntimeType.FindDirectInstance(instance.Value, new IdentifierName(memberName), 0);
                return(member != null
                             ? member.Invoke(new object[] {})
                             : TypedValue.MakeInvalid(new MemberMissingException(instance.Type, memberName, 0)));
            }
            else
            {
                RuntimeMember member = RuntimeType.FindDirectInstance(instance.Value, new IdentifierName(memberName), new[] { typeof(Parse) });
                return(member != null
                             ? member.Invoke(new object[] { parameters.Value })
                             : TypedValue.MakeInvalid(new MemberMissingException(instance.Type, memberName, 1)));
            }
        }
Ejemplo n.º 3
0
        public TypedValue Invoke(TypedValue instance, string prefixedMemberName, Tree <Cell> parameters)
        {
            var memberName = prefixedMemberName.Substring(Prefix.Length);
            var type       = Processor.ApplicationUnderTest.FindType("fit.Parse").Type;

            var runtimeType   = Processor.ApplicationUnderTest.FindType("fit.Fixtures.FlowKeywords");
            var runtimeMember = runtimeType.GetConstructor(1);
            var flowKeywords  = runtimeMember.Invoke(new [] { instance.Value });
            var member        = RuntimeType.FindDirectInstance(flowKeywords.Value, new IdentifierName(memberName), new[] { type });

            if (member != null)
            {
                return(member.Invoke(new object[] { parameters.Value }));
            }

            member = RuntimeType.FindDirectInstance(instance.Value, new IdentifierName(memberName), new[] { type });
            return(member != null
                            ? member.Invoke(new object[] { parameters.Value })
                            : TypedValue.MakeInvalid(new MemberMissingException(instance.Type, memberName, 1)));
        }