public void RemovedControlDoesNotActiveteTheWorkItem() { TestableRootWorkItem workItem = new TestableRootWorkItem(); MyControl testControl = new MyControl(); workItem.Items.Add(testControl); workItem.Items.Remove(testControl); testControl.FireEnter(); Assert.IsFalse(workItem.Status == WorkItemStatus.Active); }
public void ContainerWorkItemIsActivated() { ActivationServiceMock activation = new ActivationServiceMock(); WorkItem item = new TestableRootWorkItem(); item.Services.Add(typeof(IWorkItemActivationService), activation); MyControl ctrl = new MyControl(); IControlActivationService svc = item.Services.Get <IControlActivationService>(); item.Items.Add(ctrl); svc.ControlAdded(ctrl); ctrl.FireEnter(); Assert.AreEqual(WorkItemStatus.Active, item.Status); }