TransWikia.com

How to Mock the ActivityContext Class

Stack Overflow Asked by Mathiyazhagan on December 1, 2021

I wanted to mock the System.Activities.NativeActivityContext & System.Activities.ActivityContext for my unit test.

i.e.

using Moq;
using Autofac.Extras.Moq;

var executionContext = new Mock<NativeActivityContext>();

Since this class does not have zero parameter constructor, I’m unable to mock, neither not able to create object for this.

This is the definition of NativeActivityClass which does not have constructor defined

Note: Looks Like there is no constructor defined in this class

Can anyone help me how to mock or create object of this classes?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP