public void Execution_Recorder_Test_Priority() { var SUT = new ExecutionRecorderProcess(_manager, _methodHelper); //this process should atleast come after unit test process Assert.IsTrue(SUT.ProcessPriority > 1); }
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); }
public void Execution_Recorder_Non_Unit_Test_Config_Should_Run_Process() { var SUT = new ExecutionRecorderProcess(_manager, _methodHelper); var config = new EngineConfiguration() { IsUnitTesting = false }; var procData = new InterceptionProcessingData(_entryModel, config); Assert.IsTrue(SUT.ShouldExecuteProcess(procData)); }
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); }