Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explain some important code in examples
  • Loading branch information
alexandruchirita4192 authored May 17, 2022
commit add1900451ed10734c17e66bd6e43d648d3dd098
4 changes: 3 additions & 1 deletion samples/MediatR.Examples/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ private static bool IsExceptionHandledBy<TException, THandler>(WrappingWriter wr
{
var messages = writer.Contents.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None).ToList();

// Note: For this handler type to be found in messages, it must be written in all tested exception handlers
return messages[messages.Count - 2].Contains(typeof(THandler).FullName)
// Note: For this exception type to be found in messages, exception must be written in all tested exception handlers
&& messages[messages.Count - 3].Contains(typeof(TException).FullName);
}
}
Expand Down Expand Up @@ -336,4 +338,4 @@ public override Task WriteLineAsync(string value)
public override Encoding Encoding => _innerWriter.Encoding;

public string Contents => _stringWriter.ToString();
}
}