Пример #1
0
        public void Execution_Recorder_Override_Value_Null()
        {
            var _helper  = new Mock <IRecordedMethodHelper>();
            var _manager = new Mock <IRecordingMethodManager>();

            var SUT = new ExecutionRecorderProcess(_manager.Object, _helper.Object);
            var res = SUT.ExecuteProcess(TestClass.Method1Entry);

            Assert.IsTrue(res.OverrideValue == null);
        }
Пример #2
0
        public void Execution_Recorder_Finished_Method_Should_Be_Added_To_DAL()
        {
            var _helper  = new Mock <IRecordedMethodHelper>();
            var _manager = new Mock <IRecordingMethodManager>();

            var entry  = TestClass.Method1Entry;
            var serVal = new SerializedValue(entry.TargetType, "");

            var recMethod = new RecordingMethod(Guid.NewGuid(), serVal, entry.MethodArgs, entry.Method);

            recMethod.CloseOutMethodWithReturnVal(TestClass.Method1Exit.ReturnValue);

            _manager.Setup(x => x.ProcessCapture(It.IsAny <InterceptionProcessingData>())).Raises(f => f.MethodRecordingComplete += null, new MethodRecordingCompleteEventArgs(recMethod));

            var SUT = new ExecutionRecorderProcess(_manager.Object, _helper.Object);

            SUT.ExecuteProcess(TestClass.Method1Entry);

            _helper.Verify(x => x.AddRecordedMethod(It.IsAny <RecordedMethod>()), Times.Once);
        }