示例#1
0
 public XElement Render()
 {
     return(new XElement(NodeName,
                         new XAttribute(StubModeName, StubMode.ToString()),
                         new XElement(DescrName, Description),
                         TypeMap.Render(),
                         new XElement(CallsName,
                                      Calls.Select(c => c.Render()).ToArray())));
 }
示例#2
0
        public CallInfo FindCall(IMethodInvocation invocationInfo)
        {
            switch (StubMode)
            {
            case StubModeType.MethodName:
                return(FindCallByName(invocationInfo.MethodBase));

            case StubModeType.MethodSignature:
                return(FindCallBySignature(invocationInfo.MethodBase));

            case StubModeType.MethodArguments:
                return(FindCallByArguments(invocationInfo));

            default:
                throw new InvalidOperationException("Unknown StubMode: " + StubMode.ToString());
            }
        }