Ejemplo n.º 1
0
 public MustAssertionException(
     Exception innerException,
     MustAssertionRecord assertionRecord)
     : this(AssertionRecordHelper.BuildMessage(assertionRecord), innerException)
 {
     AssertionRecord = assertionRecord;
 }
Ejemplo n.º 2
0
        public MustAssertionReport(DateTimeOffset timestamp, MustAssertionType assertionType, MustAssertionRecord assertionRecord)
        {
            if (assertionRecord == null)
            {
                throw new ArgumentNullException(nameof(assertionRecord));
            }

            Timestamp       = timestamp;
            AssertionType   = assertionType;
            AssertionRecord = assertionRecord;
        }
Ejemplo n.º 3
0
 private static void _ReportFailure(MustAssertionType assertionType, MustAssertionRecord record, out Exception reportErrorException)
 {
     try
     {
         var _timestamp = DateTimeOffset.Now;
         _ReportSource.Push(new MustAssertionReport(_timestamp, assertionType, record));
         reportErrorException = null;
     }
     catch (Exception _exception)
     {
         reportErrorException = _exception;
     }
 }
Ejemplo n.º 4
0
        public static void ReportCustomFailure([NotNull] MustAssertionRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }

            Exception _reportErrorException;

            _ReportFailure(MustAssertionType.Custom, record, out _reportErrorException);

            if (_reportErrorException != null)
            {
                throw _reportErrorException;
            }
        }
Ejemplo n.º 5
0
 public MustAssertionException(
     MustAssertionRecord assertionRecord)
     : this(null, assertionRecord)
 {
     AssertionRecord = assertionRecord;
 }