@@ -123,7 +123,7 @@ public Activity VerifyActivityRecordedOnce()
123123
124124 public static class ActivityAssert
125125 {
126- public static KeyValuePair < string , object > HasTag ( Activity activity , string name )
126+ public static KeyValuePair < string , object > HasTag ( this Activity activity , string name )
127127 {
128128 KeyValuePair < string , object > tag = activity . TagObjects . SingleOrDefault ( t => t . Key == name ) ;
129129 if ( tag . Key is null )
@@ -134,7 +134,7 @@ public static KeyValuePair<string, object> HasTag(Activity activity, string name
134134 return tag ;
135135 }
136136
137- public static void HasTag < T > ( Activity activity , string name , T expectedValue )
137+ public static void HasTag < T > ( this Activity activity , string name , T expectedValue )
138138 {
139139 KeyValuePair < string , object > tag = HasTag ( activity , name ) ;
140140 Assert . Equal ( expectedValue , ( T ) tag . Value ) ;
@@ -147,14 +147,19 @@ public static void HasRecordedException(this Activity activity, Exception except
147147 Assert . Equal ( exception . GetType ( ) . ToString ( ) ,
148148 exceptionEvent . Tags . SingleOrDefault ( t => t . Key == "exception.type" ) . Value ) ;
149149 }
150+
151+ public static void IsInError ( this Activity activity )
152+ {
153+ Assert . Equal ( ActivityStatusCode . Error , activity . Status ) ;
154+ }
150155
151- public static void HasNoTag ( Activity activity , string name )
156+ public static void HasNoTag ( this Activity activity , string name )
152157 {
153158 bool contains = activity . TagObjects . Any ( t => t . Key == name ) ;
154159 Assert . False ( contains , $ "The Activity tags should not contain { name } .") ;
155160 }
156161
157- public static void FinishedInOrder ( Activity first , Activity second )
162+ public static void FinishedInOrder ( this Activity first , Activity second )
158163 {
159164 Assert . True ( first . StartTimeUtc + first . Duration < second . StartTimeUtc + second . Duration ,
160165 $ "{ first . OperationName } should stop before { second . OperationName } ") ;
0 commit comments