public void VerifyNothingElse(int time) { var expectations = Expectations.Where(e => e.Time == time).Where(e => e.Marble == null).ToList(); if (!expectations.Any()) { return; } foreach (var exp in expectations) { try { exp.Assertion(); } catch (Exception e) { throw new Exception( $"At time {time}, unexpected events were received {ErrorMessageHelper.SequenceWithPointerToOffendingMoment(Sequence, time)}{Environment.NewLine}{e.Message}.", e); } } }
private void InvokeAssertions(int time, List <ExpectedMarble> expectations) { if (!expectations.Any()) { return; } foreach (var exp in expectations) { try { exp.Assertion(); } catch (MissingEventException mee) { throw new Exception( $"At time {time}, for marble '{exp.Marble}' not all expected events were received {ErrorMessageHelper.SequenceWithPointerToOffendingMoment(Sequence, time)}{Environment.NewLine}{mee.Message}.", mee); } }
private async Task Run(InputMarble m, int time) { try { await m.Action(); } catch (Exception e) { throw new Exception( $"At time {time}, there was an error when firing marble '{m.Marble}' {ErrorMessageHelper.SequenceWithPointerToOffendingMoment(Sequence, time)}", e); } }