コード例 #1
0
        private void ProcessEntry(InterceptionProcessingData data, List <RecordingMethod> methods, Guid executingMethodId, int threadId)
        {
            Guid newMethodId = Guid.NewGuid();

            //add this as a method
            if (!HasSerializationErrors(data))
            {
                var serInstance = _serializationHelper.Serialize(data.TargetInstance);

                if (!serInstance.Success)
                {
                    throw new AutoTestEngineException($"Unable to serialize type {data.TargetInstance.ToString()} despite not having a serialization failure on the processing datat context");
                }



                var newMethod = new RecordingMethod(newMethodId, serInstance.SerializedValue, data.MethodArgs, data.Method);
                methods.Add(newMethod);
            }

            //add this as a sub-method if applicable
            var executingMethod = methods.FirstOrDefault(x => x.Identifier == executingMethodId);

            if (executingMethod != null)
            {
                var subMethod = new RecordedSubMethod(newMethodId, data.TargetType, data.MethodArgs, data.ReturnType, data.Method);
                executingMethod.SubMethods.Add(subMethod);
            }

            _executionStack.ProcessEntry(threadId, newMethodId);
        }
コード例 #2
0
 public MethodRecordingCompleteEventArgs(RecordingMethod method)
 {
     this.Method = method;
 }