public void TestMultipleProcessDomains()
{
// Along with enabling support for TypeFilterLevel = Full, we also have to allow multiple
// channels to be created. This will simply do just that and ensure there's no
// duplicate channel registration exceptions
using (var domain1 = ProcessDomain.CreateDomain("Domain1"))
using (var domain2 = ProcessDomain.CreateDomain("Domain2"))
{
var obj1 = (RemoteTestObject)domain1.CreateInstanceAndUnwrap(TestObjectAssemblyName, TestObjectTypeName);
var obj2 = (RemoteTestObject)domain2.CreateInstanceAndUnwrap(TestObjectAssemblyName, TestObjectTypeName);
Assert.That(!obj1.CalledBack);
Assert.That(!obj2.CalledBack);
obj1.SetCalledBack();
obj2.SetCalledBack();
Assert.That(obj1.CalledBack);
Assert.That(obj2.CalledBack);
}
}