Subscribe() public method

public Subscribe ( WorkItemSubscribeRequest request ) : WorkItemSubscribeResponse
request WorkItemSubscribeRequest
return WorkItemSubscribeResponse
Beispiel #1
0
        public void TestTestWorkItemService()
        {
            ResetCallbackFields();
            var service = new TestWorkItemService {
                Callback = this
            };
            var callback = (IWorkItemActivityCallback)service;

            var item = new WorkItemData {
                Type = DicomRetrieveRequest.WorkItemTypeString
            };
            var items = new List <WorkItemData> {
                item
            };
            var eventType = WorkItemsChangedEventType.Update;

            callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(0, WorkItemChangedCallbackCount);

            service.Subscribe(new WorkItemSubscribeRequest());

            callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(1, WorkItemChangedCallbackCount);

            service.Unsubscribe(new WorkItemUnsubscribeRequest());
            callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(1, WorkItemChangedCallbackCount);
        }
Beispiel #2
0
        public void TestTestWorkItemService()
        {
            ResetCallbackFields();
            var service = new TestWorkItemService{Callback = this};
            var callback = (IWorkItemActivityCallback) service;

            var item = new WorkItemData { Type = DicomRetrieveRequest.WorkItemTypeString };
        	var items = new List<WorkItemData> {item};
        	var eventType = WorkItemsChangedEventType.Update;

			callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(0, WorkItemChangedCallbackCount);

            service.Subscribe(new WorkItemSubscribeRequest());

			callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(1, WorkItemChangedCallbackCount);

            service.Unsubscribe(new WorkItemUnsubscribeRequest());
			callback.WorkItemsChanged(eventType, items);
            Assert.AreEqual(1, WorkItemChangedCallbackCount);
        }