Thank you for contacting Telerik support.
To show you how "OperationContext" can be faked with JustMock, I prepared the following example:
var mock = Mock.Create<OperationContext>(Constructor.Mocked);
Mock.Arrange(() => mock.SessionId).Returns(
// Will arrange the "SessionId" property to return certain string ("Telerik").
Mock.Arrange(() => OperationContext.Current).Returns(mock);
// Will arrange the static "OperationContext.Current" to return mocked instance when called.
var actual = OperationContext.Current.SessionId;
// Will assert the expected results
I hope the above helps.
However, to assist you further with your certain scenario, I will need a sample project with the system under test. You can archive and attach it with your next message.
You could also check our online help documentation
. There are a lot of mocking examples, that should help.
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums
, or our JustTrace