public async Task can_reload_the_error_report() { await theCallback.MoveToErrors(theEnvelope, new Exception("Boom!")); theRetries.ErrorReportLogged.WaitOne(500); var report = await thePersistor.LoadDeadLetterEnvelope(theEnvelope.Id); report.ExceptionMessage.ShouldBe("Boom!"); }
public async Task move_to_errors_persists_the_error_report() { await theCallback.MoveToErrors(theEnvelope, new Exception("Boom!")); theRetries.ErrorReportLogged.WaitOne(500); var persisted = thePersistor.AllIncomingEnvelopes().FirstOrDefault(x => x.Id == theEnvelope.Id); persisted.ShouldBeNull(); var report = await thePersistor.LoadDeadLetterEnvelope(theEnvelope.Id); report.ExceptionMessage.ShouldBe("Boom!"); }
public async Task load_dead_letter_envelope() { var list = new List <Envelope>(); for (int i = 0; i < 10; i++) { var envelope = ObjectMother.Envelope(); envelope.Status = TransportConstants.Incoming; list.Add(envelope); } await thePersistor.StoreIncoming(list.ToArray()); var ex = new DivideByZeroException("Kaboom!"); var report2 = new ErrorReport(list[2], ex); var report3 = new ErrorReport(list[3], ex); var report4 = new ErrorReport(list[4], ex); await thePersistor.MoveToDeadLetterStorage(new ErrorReport[] { report2, report3, report4 }); var stored = await thePersistor.LoadDeadLetterEnvelope(report2.Id); stored.ShouldNotBeNull(); stored.ExceptionMessage.ShouldBe(report2.ExceptionMessage); stored.Id.ShouldBe(report2.Id); stored.ExceptionText.ShouldBe(report2.ExceptionText); stored.ExceptionType.ShouldBe(report2.ExceptionType); stored.Explanation.ShouldBe(report2.Explanation); stored.MessageType.ShouldBe(report2.MessageType); stored.RawData.ShouldBe(report2.RawData); stored.Source.ShouldBe(report2.Source); }