Пример #1
0
 protected virtual void OnGenerationError(TestGenerationError testGenerationError)
 {
     if (GenerationError != null)
     {
         GenerationError(testGenerationError);
     }
 }
Пример #2
0
        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);
        }
Пример #4
0
        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);
        }