Hello,
I have a WCF service in which I have set up a Mock on my Entity it works well as long as I reference my dll
Now I would go further and directly referencing my service ".svc" and indicate to the execution of my service I want to distort my Entity via a method
public enum TestContext
{
Default
}
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class ExampleService : IExample
{
public void TestContext(TestContext testContext)
{
MockService.Initialize(testContext);
}
}
with
public static class MockService
{
public static void Initialize(TestContext testContext)
{
var dataTiers = new List<TIERS>
{
new TIERS {ID_TIERS = 1}
}.AsQueryable();
var context = Isolate.Fake.AllInstances<EntityContainer>();
Isolate.WhenCalled(() => context.TIERS).WillReturnCollectionValuesOf(dataTiers);
}
}
My problem is Isolate is not started because the service is independent of the unit test
(I saw it was possible to launch TMockRunner but it always seems couple with unit test)
So it is possible to launch Isolate via the dll of my service directly?
Thx