Create OMMItemEvent and Data.FieldList - RFA.NET
I trying to make unit tests of my ProcessEvent in my Client class decentant as well as my DecodeMsg. And for that purpose I need to create test data
For ProcessEvent I need to create ThomsonReuters.RFA.SessionLayer.OMMItemEvent's to test my branches.
And for DecodeMsg I need to create ThomsonReuters.RFA.Data.FieldList as far as I can see. I thing I have figure a way to store the data but I can get the other way.
My basic problem is that I can find a way to create these classes and get them setup in RFA.NET
/Jens G
Best Answer
-
Hi @jens
As you may have noted from the RFA.net documentation, there are no constructor methods exposed for OmmItemEvent, OmmConnectionEvent etc.
That is why I suggested you connect your consumer to one of the Interactive Provider examples and modify the Provider source code to generate the events as required for your test scenarios.
This is the normal route RFA.Net developers take for testing their consumer applications.
0
Answers
-
Hi @jens
I am assuming you are developing a Consumer; a good way to test your consumer is to run an Interactive Provider example and connect the consumer directly to the provider. As we provide the source code for the Interactive Provider you can edit it to suit your testing requirements.
If you refer to the Examples folder you should find the StarterProvider_Interactive and the Provider_Interactive.
If you configure the IProvider to listen on the same port as your Consumer .e.g. 14002 the default and you set the serverList/hostName value to wherever the IProvider is running e.g. localhost - then the Consumer should connect directly to the Provider.
You can refer to the README.txt file in the individual example's folder for more detail.
0 -
Well I already have programmed my consumer at it works like it should. But now I want to make unit test of the individual classes.
So now I have a method like this:
public void ProcessEvent(Event evnt)
{
if (evnt == null)
return;
switch (evnt.Type)
{
case SessionLayerEventTypeEnum.ConnectionEvent:
ProcessConnectionEvent(evnt as OMMConnectionEvent);
break;
case SessionLayerEventTypeEnum.OMMItemEvent:
ProcessOMMItemEvent(evnt as OMMItemEvent);
break;
default:
logHandler.LogWarning(string.Format("<- Received event with unknown event type: {0}", evnt.Type));
break;
}
}
And I wand to make a test of the method. I would do something like this
OMMConnectionEvent evnt = new OMMConnectionEvent();
// Setup event
rc.ProcessEvent(evnt );
Assert....
But my problem is that I can not figure out how to create OMMConnectionEvent or any other event for that matter to simulate event comming from the API.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 167 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 688 Datastream
- 1.4K DSS
- 624 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 692 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 105 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 10 Wealth Management Web Services
- 91 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛