File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Open.ChannelExtensions.Tests Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11using System . Runtime . CompilerServices ;
2- using System . Threading . Channels ;
3- using System . Threading ;
42
53namespace Open . ChannelExtensions . Tests ;
64
Original file line number Diff line number Diff line change 1- using System . Threading . Tasks ;
2- using System . Xml . Linq ;
3-
4- namespace Open . ChannelExtensions . Tests ;
1+ namespace Open . ChannelExtensions . Tests ;
52public class PipelineExceptionTests
63{
74 const int BatchSize = 20 ;
85 const int Elements = 100 ;
96 readonly Channel < int > _channel ;
7+
8+ #pragma warning disable IDE0052 // Remove unread private members
9+ // for debugging
1010 int _thrown = - 2 ;
11+ #pragma warning restore IDE0052 // Remove unread private members
1112
1213 public PipelineExceptionTests ( )
1314 {
1415 _channel = Channel . CreateBounded < int > ( 10000 ) ;
1516 for ( var i = 0 ; i < 100 ; i ++ )
1617 {
1718 if ( ! _channel . Writer . TryWrite ( i ) )
18- throw new Exception ( "Failed to write " + i ) ;
19+ throw new Exception ( $ "Failed to write { i } " ) ;
1920 }
2021 }
2122
2223 Func < int , int > CreateThrowIfEqual ( int elementToThrow ) => element =>
2324 {
2425 if ( elementToThrow != - 1 && element != elementToThrow )
2526 return element ;
27+
2628 _thrown = element ;
27- throw new Exception ( "Thrown at " + element ) ;
29+ throw new Exception ( $ "Thrown at { element } " ) ;
2830 } ;
2931
3032 ChannelReader < int > PrepareStage1 ( int elementToThrow ) =>
Original file line number Diff line number Diff line change 3131 <PackageIcon >logo.png</PackageIcon >
3232 <PackageReadmeFile >README.md</PackageReadmeFile >
3333 <!-- Don't enforce collection expressions as they don't work in .NET 6. -->
34- <NoWarn >IDE0301;IDE0303;IDE0304</NoWarn >
34+ <NoWarn >IDE0130; IDE0301;IDE0303;IDE0304; </NoWarn >
3535 </PropertyGroup >
3636
3737 <ItemGroup >
You can’t perform that action at this time.
0 commit comments