Esempio n. 1
0
		public void StatusIsInactiveAfterDeactivateCalled()
		{
			WorkItem wi = new TestableRootWorkItem();

			wi.Activate();
			wi.Deactivate();

			Assert.AreEqual(WorkItemStatus.Inactive, wi.Status);
		}
Esempio n. 2
0
		public void WorkItemPassesItselfToActivationServiceWhenDeactivated()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockWorkItemActivationService svc = wi.Services.AddNew<MockWorkItemActivationService, IWorkItemActivationService>();

			wi.Activate();
			wi.Deactivate();

			Assert.AreEqual(wi, svc.LastChangedItem);
		}
Esempio n. 3
0
		public void WorkItemCallsActivationServiceWhenDeactivated()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockWorkItemActivationService svc = wi.Services.AddNew<MockWorkItemActivationService, IWorkItemActivationService>();

			wi.Activate();
			wi.Deactivate();

			Assert.IsTrue(svc.ChangeStatusCalled);
		}
Esempio n. 4
0
		public void FiresDeactivatingEventWhenDeactivated()
		{
			WorkItem wi = new TestableRootWorkItem();

			bool deactivating = false;
			wi.Deactivating += delegate { deactivating = true; };
			wi.Activate();
			wi.Deactivate();

			Assert.IsTrue(deactivating);
		}
Esempio n. 5
0
		public void CanCancelDeactivation()
		{
			WorkItem wi = new TestableRootWorkItem();

			bool deactivated = false;
			wi.Deactivated += delegate { deactivated = true; };
			wi.Deactivating += delegate(object sender, CancelEventArgs e) { e.Cancel = true; };
			wi.Activate();
			wi.Deactivate();

			Assert.IsFalse(deactivated);
		}