Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by jens · Sep 13, 2019 at 07:42 AM · rfa.netunittest.net c#

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

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Sep 16, 2019 at 03:09 PM

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.



Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by umer.nalla · Sep 13, 2019 at 09:57 AM

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.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by jens · Sep 16, 2019 at 01:57 PM

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.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

RegisterClient and Client callback

Visual Studio 2017 support

RIC deletion using C# .NET

C# RFA (Dead Stop)

What is the difference between RFA_NET120_64 vs RFA_NET100_64 DLLs ?

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges