@@ -103,12 +103,16 @@ public void IsBlankIfNoHeader()
103103 Assert . False ( ctx . ActivityContext . IsValid ( ) ) ;
104104 }
105105
106- [ Fact ]
107- public void IsBlankIfInvalid ( )
106+ [ Theory ]
107+ [ InlineData ( $ "00-xyz7651916cd43dd8448eb211c80319c-{ SpanId } -01") ]
108+ [ InlineData ( $ "00-{ TraceId } -xyz7c989f97918e1-01") ]
109+ [ InlineData ( $ "00-{ TraceId } -{ SpanId } -x1") ]
110+ [ InlineData ( $ "00-{ TraceId } -{ SpanId } -1x") ]
111+ public void IsBlankIfInvalid ( string invalidTraceParent )
108112 {
109113 var headers = new Dictionary < string , string >
110114 {
111- { TraceParent , $ "00-xyz7651916cd43dd8448eb211c80319c- { SpanId } -01" } ,
115+ { TraceParent , invalidTraceParent } ,
112116 } ;
113117
114118 var f = new TraceContextPropagator ( ) ;
@@ -191,8 +195,8 @@ public void DuplicateKeys()
191195 // test_tracestate_duplicated_keys
192196 Assert . Empty ( CallTraceContextPropagator ( "foo=1,foo=1" ) ) ;
193197 Assert . Empty ( CallTraceContextPropagator ( "foo=1,foo=2" ) ) ;
194- Assert . Empty ( CallTraceContextPropagator ( new string [ ] { "foo=1" , "foo=1" } ) ) ;
195- Assert . Empty ( CallTraceContextPropagator ( new string [ ] { "foo=1" , "foo=2" } ) ) ;
198+ Assert . Empty ( CallTraceContextPropagator ( new [ ] { "foo=1" , "foo=1" } ) ) ;
199+ Assert . Empty ( CallTraceContextPropagator ( new [ ] { "foo=1" , "foo=2" } ) ) ;
196200 }
197201
198202 [ Fact ]
@@ -318,7 +322,7 @@ private static string CallTraceContextPropagator(string[] tracestate)
318322 {
319323 var headers = new Dictionary < string , string [ ] >
320324 {
321- { TraceParent , new string [ ] { $ "00-{ TraceId } -{ SpanId } -01" } } ,
325+ { TraceParent , new [ ] { $ "00-{ TraceId } -{ SpanId } -01" } } ,
322326 { TraceState , tracestate } ,
323327 } ;
324328 var f = new TraceContextPropagator ( ) ;
0 commit comments