public void Dev2StateAuditLogger_LogPreExecuteState_Tests() { var expectedWorkflowId = Guid.NewGuid(); var expectedWorkflowName = "LogPreExecuteState_Workflow"; TestAuditSetupWithAssignedInputs(expectedWorkflowId, expectedWorkflowName, out _dev2StateAuditLogger, out _activity); // test _dev2StateAuditLogger.NewStateListener(_dSFDataObject).LogPreExecuteState(_activity.Object); // verify _dev2StateAuditLogger.Flush(); var str = expectedWorkflowId.ToString(); var results = Dev2StateAuditLogger.Query(a => a.WorkflowID == str); _dev2StateAuditLogger.Dispose(); foreach (var item in results) { } var result = results.FirstOrDefault(a => a.WorkflowID == str); Assert.IsTrue(result != null); Assert.AreEqual("{\"Environment\":{\"scalars\":{},\"record_sets\":{},\"json_objects\":{}},\"Errors\":[],\"AllErrors\":[]}", result.Environment); }
public void Dev2StateAuditLogger_LogPostExecuteState_Tests() { var expectedWorkflowId = Guid.NewGuid(); var expectedWorkflowName = "LogPostExecuteState_Workflow"; TestAuditSetupWithAssignedInputs(expectedWorkflowId, expectedWorkflowName, out _dev2StateAuditLogger, out _activity); // test var previousActivity = new Mock <IDev2Activity>(); var nextActivity = new Mock <IDev2Activity>(); _dev2StateAuditLogger.NewStateListener(_dSFDataObject).LogPostExecuteState(previousActivity.Object, nextActivity.Object); _dev2StateAuditLogger.Flush(); // verify var str = expectedWorkflowId.ToString(); var results = Dev2StateAuditLogger.Query(a => (a.WorkflowID.Equals(str) || a.WorkflowName.Equals("LogPostExecuteState") || a.ExecutionID.Equals("") || a.AuditType.Equals(""))); _dev2StateAuditLogger.Dispose(); Assert.IsTrue(results.FirstOrDefault(a => a.WorkflowID == str) != null); }
public void Dev2StateAuditLogger_LogAdditionalDetail_Tests() { var expectedWorkflowId = Guid.NewGuid(); var expectedWorkflowName = "LogAdditionalDetail_Workflow"; TestAuditSetupWithAssignedInputs(expectedWorkflowId, expectedWorkflowName, out _dev2StateAuditLogger, out _activity); // test var additionalDetailObject = new { Message = "Some Message" }; _dev2StateAuditLogger.NewStateListener(_dSFDataObject).LogAdditionalDetail(additionalDetailObject, ""); _dev2StateAuditLogger.Flush(); // verify var str = expectedWorkflowId.ToString(); var results = Dev2StateAuditLogger.Query(a => (a.WorkflowID.Equals(str) || a.WorkflowName.Equals("LogAdditionalDetail") || a.ExecutionID.Equals("") || a.AuditType.Equals(""))); _dev2StateAuditLogger.Dispose(); Assert.IsTrue(results.FirstOrDefault(a => a.WorkflowID == str) != null); }
public void Dev2StateAuditLogger_LogExecuteException_Tests() { var expectedWorkflowId = Guid.NewGuid(); var expectedExecutionId = Guid.NewGuid(); var expectedWorkflowName = "LogExecuteException_Workflow"; TestAuditSetupWithAssignedInputs(expectedWorkflowId, expectedWorkflowName, expectedExecutionId, out _dev2StateAuditLogger, out _activity); // test var activity = new Mock <IDev2Activity>(); var exception = new Mock <Exception>(); _dev2StateAuditLogger.LogExecuteException(exception.Object, activity.Object); // verify var str = expectedWorkflowId.ToString(); var results = Dev2StateAuditLogger.Query(a => (a.WorkflowID.Equals(str) || a.WorkflowName.Equals("LogExecuteException") || a.ExecutionID.Equals("") || a.AuditType.Equals(""))); _dev2StateAuditLogger.Dispose(); Assert.IsTrue(results.FirstOrDefault(a => a.WorkflowID == str) != null); }