public void TestActivityMonitorProxySubscriptions() { _expectingAsyncEvents = false; var testMonitor = new TestActivityMonitor(); var monitorProxy = new WorkItemActivityMonitorProxy(testMonitor, null); TestActivityMonitorSubscriptions(monitorProxy, testMonitor); }
public void TestActivityMonitorProxyConnected() { ResetCallbackFields(); var test = new TestActivityMonitor(); var proxy = new WorkItemActivityMonitorProxy(test, null); test.IsConnected = true; Assert.AreEqual(0, IsConnectedChangedCount); proxy.IsConnectedChanged += OnIsConnectedChanged; test.IsConnected = true; Assert.AreEqual(0, IsConnectedChangedCount); test.IsConnected = false; Assert.AreEqual(1, IsConnectedChangedCount); test.IsConnected = true; Assert.AreEqual(2, IsConnectedChangedCount); proxy.IsConnectedChanged -= OnIsConnectedChanged; test.IsConnected = false; Assert.AreEqual(2, IsConnectedChangedCount); }