Hi there,
I am testing method that inserts data into a table in the database and returns the ID.
My class(not the test class business logic class) is no way related to any wcf service but after inserting data my method calling context.savechanges() method then its validating my credentials. For the validation I have validation.cs. There its checking the headers
in the operation context. Is there anyway to get around the OperationContext. I am using JustMock 30 day Trial version. I tried the following code
IContextChannel channel = null;
var context = Mock.Create<OperationContext>(()=>new OperationContext(channel));
OperationContext.Current = context;
MessageHeader header = MessageHeader.CreateHeader(CustomHeader.Header, CustomHeader.HeaderNamespace, customHeader);
Mock.Arrange(() => context.OutgoingMessageHeaders.Add(header));
I have been trying to solve this for the last 2 days.
Thank so much for ur help in advance
I am testing method that inserts data into a table in the database and returns the ID.
My class(not the test class business logic class) is no way related to any wcf service but after inserting data my method calling context.savechanges() method then its validating my credentials. For the validation I have validation.cs. There its checking the headers
in the operation context. Is there anyway to get around the OperationContext. I am using JustMock 30 day Trial version. I tried the following code
IContextChannel channel = null;
var context = Mock.Create<OperationContext>(()=>new OperationContext(channel));
OperationContext.Current = context;
MessageHeader header = MessageHeader.CreateHeader(CustomHeader.Header, CustomHeader.HeaderNamespace, customHeader);
Mock.Arrange(() => context.OutgoingMessageHeaders.Add(header));
I have been trying to solve this for the last 2 days.
Thank so much for ur help in advance