@@ -73,10 +73,10 @@ public async Task LinearProcessWithCloudEventSubscribersUsingEmitToTopicAsync()
73
73
Assert . NotNull ( mockClient ) ;
74
74
Assert . True ( mockClient . InitializationCounter > 0 ) ;
75
75
Assert . Equal ( 2 , mockClient . CloudEvents . Count ) ;
76
- Assert . Equal ( runningProcessId , mockClient . CloudEvents [ 0 ] . Data ? . ProcessId ) ;
77
- Assert . Equal ( runningProcessId , mockClient . CloudEvents [ 1 ] . Data ? . ProcessId ) ;
78
- this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] . Data , expectedPublishTopic : MockTopicNames . EchoExternalTopic , expectedTopicData : testInput ) ;
79
- this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] . Data , expectedPublishTopic : MockTopicNames . RepeatExternalTopic , expectedTopicData : $ "{ testInput } { testInput } ") ;
76
+ Assert . Equal ( runningProcessId , mockClient . CloudEvents [ 0 ] . ProcessId ) ;
77
+ Assert . Equal ( runningProcessId , mockClient . CloudEvents [ 1 ] . ProcessId ) ;
78
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] , expectedPublishTopic : MockTopicNames . EchoExternalTopic , expectedTopicData : testInput ) ;
79
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] , expectedPublishTopic : MockTopicNames . RepeatExternalTopic , expectedTopicData : $ "{ testInput } { testInput } ") ;
80
80
}
81
81
82
82
/// <summary>
@@ -111,15 +111,15 @@ public async Task ProcessWithSubprocessWithProxyEmittingDifferentTopicsAsync()
111
111
Assert . NotNull ( mockClient ) ;
112
112
Assert . True ( mockClient . InitializationCounter > 0 ) ;
113
113
Assert . Equal ( 2 , mockClient . CloudEvents . Count ) ;
114
- if ( mockClient . CloudEvents [ 0 ] . TopicName == this . _topic1 )
114
+ if ( mockClient . CloudEvents [ 0 ] . ExternalTopicName == this . _topic1 )
115
115
{
116
- this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] . Data , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
117
- this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] . Data , expectedPublishTopic : this . _topic2 , expectedTopicData : testInput ) ;
116
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
117
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] , expectedPublishTopic : this . _topic2 , expectedTopicData : testInput ) ;
118
118
}
119
119
else
120
120
{
121
- this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] . Data , expectedPublishTopic : this . _topic2 , expectedTopicData : testInput ) ;
122
- this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] . Data , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
121
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] , expectedPublishTopic : this . _topic2 , expectedTopicData : testInput ) ;
122
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
123
123
}
124
124
}
125
125
@@ -155,8 +155,8 @@ public async Task ProcessWithSubprocessWithProxyEmittingSameTopicsAsync()
155
155
Assert . NotNull ( mockClient ) ;
156
156
Assert . True ( mockClient . InitializationCounter > 0 ) ;
157
157
Assert . Equal ( 2 , mockClient . CloudEvents . Count ) ;
158
- this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] . Data , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
159
- this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] . Data , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
158
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 0 ] , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
159
+ this . AssertProxyMessage ( mockClient . CloudEvents [ 1 ] , expectedPublishTopic : this . _topic1 , expectedTopicData : testInput ) ;
160
160
}
161
161
162
162
/// <summary>
@@ -225,17 +225,11 @@ private void AssertProxyMessage(KernelProcessProxyMessage? proxyMessage, string
225
225
Assert . NotNull ( proxyMessage ) ;
226
226
Assert . IsType < KernelProcessProxyMessage > ( proxyMessage ) ;
227
227
Assert . Equal ( expectedPublishTopic , proxyMessage . ExternalTopicName ) ;
228
- if ( proxyMessage . EventData is JsonElement jsonEventData )
229
- {
230
- // needed for Dapr Testing setup since it serializes everything with json
231
- Assert . Equal ( JsonValueKind . String , jsonEventData . ValueKind ) ;
232
- Assert . Equal ( expectedTopicData , jsonEventData . ToString ( ) ) ;
233
- }
234
- else
235
- {
236
- Assert . IsType < string > ( proxyMessage . EventData ) ;
237
- Assert . Equal ( expectedTopicData , proxyMessage . EventData ) ;
238
- }
228
+
229
+ Assert . IsType < KernelProcessEventData > ( proxyMessage . EventData ) ;
230
+ var outputEventData = proxyMessage . EventData . ToObject ( ) ;
231
+ Assert . IsType < string > ( outputEventData ) ;
232
+ Assert . Equal ( expectedTopicData , outputEventData ) ;
239
233
}
240
234
#endregion
241
235
}
0 commit comments