File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,34 @@ public void ShouldPassInRequests()
7070 }
7171 }
7272
73+ [ Fact ]
74+ public void ShouldHaveAThreadName ( )
75+ {
76+ var threadName = "(untouched)" ;
77+ var inputStream = new MemoryStream ( Encoding . ASCII . GetBytes ( "Content-Length: 2\r \n \r \n {}" ) ) ;
78+ var reciever = Substitute . For < IReciever > ( ) ;
79+
80+ using ( NewHandler (
81+ inputStream ,
82+ Substitute . For < IOutputHandler > ( ) ,
83+ reciever ,
84+ Substitute . For < IRequestProcessIdentifier > ( ) ,
85+ Substitute . For < IRequestRouter > ( ) ,
86+ Substitute . For < IResponseRouter > ( ) ,
87+ cts => {
88+ reciever . When ( x => x . IsValid ( Arg . Any < JToken > ( ) ) )
89+ . Do ( x => {
90+ threadName = System . Threading . Thread . CurrentThread . Name ;
91+ cts . Cancel ( ) ;
92+ } ) ;
93+ } ) )
94+ {
95+ reciever . Received ( ) ;
96+ threadName . Should ( ) . Be ( "ProcessInputStream" , because : "it is easier to find it in the Threads pane by it's name" ) ;
97+ }
98+
99+ }
100+
73101 [ Fact ]
74102 public void ShouldPassInUtf8EncodedRequests ( )
75103 {
You can’t perform that action at this time.
0 commit comments