Inheritance: IDebugWriter
Beispiel #1
0
        void PerformExecution()
        {
            var esbChannel      = new EsbServicesEndpoint();
            var testDebugWriter = new TestDebugWriter();
            var debugWriter     = DebugDispatcher.Instance.Get(Guid.Empty);

            if (debugWriter != null)
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }
            DebugDispatcher.Instance.Add(Guid.Empty, testDebugWriter);
            IDSFDataObject result = ExecuteProcess(isDebug: true, channel: esbChannel, throwException: false);

            try
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch (Exception)
            // ReSharper restore EmptyGeneralCatchClause
            {
                //May already been removed
            }
            var debugStates = testDebugWriter.DebugStates.Where(a => a.StateType != StateType.Duration).ToList();
            var duration    = testDebugWriter.DebugStates.Where(a => a.StateType == StateType.Duration).ToList();

            ScenarioContext.Current.Add("duration", duration);
            testDebugWriter.DebugStates.Clear();
            ScenarioContext.Current.Add("result", result);
            CheckDebugStates(debugStates);
        }
Beispiel #2
0
        void PerformExecution()
        {
            var esbChannel      = new EsbServicesEndpoint();
            var testDebugWriter = new TestDebugWriter();
            var debugWriter     = DebugDispatcher.Instance.Get(Guid.Empty);

            if (debugWriter != null)
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }
            DebugDispatcher.Instance.Add(Guid.Empty, testDebugWriter);
            var result = ExecuteProcess(isDebug: true, channel: esbChannel, throwException: false);

            Thread.Sleep(2000);
            var states      = testDebugWriter.DebugStates;
            var debugStates = states.Where(a => a.StateType != StateType.Duration).ToList();
            var duration    = states.Where(a => a.StateType == StateType.Duration).ToList();

            scenarioContext.Add("duration", duration);
            scenarioContext.Add("result", result);
            CheckDebugStates(debugStates);
            try
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }

            catch (Exception)

            {
                //May already been removed
            }
        }
        void PerformExecution()
        {
            var esbChannel = new EsbServicesEndpoint();
            var testDebugWriter = new TestDebugWriter();
            var debugWriter = DebugDispatcher.Instance.Get(Guid.Empty);
            if(debugWriter != null)
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }
            DebugDispatcher.Instance.Add(Guid.Empty, testDebugWriter);
            IDSFDataObject result = ExecuteProcess(isDebug: true, channel: esbChannel, throwException: false);
            try
            {
                DebugDispatcher.Instance.Remove(Guid.Empty);
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch(Exception)
            // ReSharper restore EmptyGeneralCatchClause
            {
                //May already been removed
            }
            var debugStates = testDebugWriter.DebugStates.Where(a=>a.StateType!=StateType.Duration).ToList();
            var duration = testDebugWriter.DebugStates.Where(a => a.StateType == StateType.Duration).ToList();
            ScenarioContext.Current.Add("duration", duration);
            testDebugWriter.DebugStates.Clear();
            ScenarioContext.Current.Add("result", result);
            CheckDebugStates(debugStates);

        }