protected virtual void OnGenerationError(TestGenerationError testGenerationError) { if (GenerationError != null) { GenerationError(testGenerationError); } }
private string GenerateError(Exception ex, CodeDomHelper codeDomHelper) { TestGenerationError testGenerationError = new TestGenerationError(ex); OnGenerationError(testGenerationError); return(codeDomHelper.GetErrorStatementString(testGenerationError.Message)); }
private string GenerateError(Exception ex, CodeDomHelper codeDomHelper) { TestGenerationError testGenerationError = new TestGenerationError(ex); OnGenerationError(testGenerationError); var errorMessage = string.Join(Environment.NewLine, testGenerationError.ToString() .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) .Select(codeDomHelper.GetErrorStatementString)); return(errorMessage); }
private string GenerateError(Exception ex, CodeDomHelper codeDomHelper) { TestGenerationError testGenerationError = new TestGenerationError(ex); var exceptionText = ex.Message + Environment.NewLine + Environment.NewLine + ex.Source + Environment.NewLine + ex.StackTrace; var errorMessage = string.Join(Environment.NewLine, exceptionText .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) .Select(codeDomHelper.GetErrorStatementString)); return(errorMessage); }