Binu Vijayan
Binu Vijayan

Reputation: 803

How to Mock Service Initialization Parameters in Service Fabric for Unit Testing similar to mocking the state using a mock class?

I am writing Unit tests for a Service Fabric Reliable Service. My application is an OWIN hosted Stateless service, I want to write Unit test for Communication listener, Which uses ServiceInitializationParameters class. I can't initialize a dummy object of this type since all the fields are read only and no public constructor is available. For State in service fabric, We can mock it by using a mock class which implements an interface for state.

Is there any similar way to mock the Service Initialization Parameters ?

Upvotes: 0

Views: 841

Answers (1)

Vaclav Turecek
Vaclav Turecek

Reputation: 9050

Yeah you can't mock out ServiceInitializationParameters in the current release, but you will be able to in an upcoming release, so stay tuned for that.

Upvotes: 2

Related Questions