public void TestRevokeActualOwner() { IdentityId actualId = new IdentityId(); ILoggingService loggingService = SetupLoggerMock(new List<TaskHistoryEvent>()); Task task = new Task( new TaskId(), TaskStatus.Reserved, string.Empty, string.Empty, Priority.Normal, false, DateTime.UtcNow, new IdentityId().GetIdentity(), DateTime.UtcNow, null, actualId.GetIdentity()) { LoggingService = loggingService }; IPrincipal actualOwner = new ClaimsPrincipal(actualId.GetIdentity()); Thread.CurrentPrincipal = actualOwner; task.Release(); Assert.AreEqual(TaskStatus.Ready, task.Status); Assert.IsNull(task.ActualOwner); Assert.IsNotNull(task.History); Assert.AreEqual(1, task.History.Count()); TaskHistoryEvent history = task.History.ElementAt(0); Assert.IsNotNull(history); Assert.AreEqual(TaskStatus.Reserved, history.OldStatus); Assert.AreEqual(TaskStatus.Ready, history.NewStatus); Assert.AreEqual(actualId, history.UserId); Assert.AreEqual(actualId,history.StartOwner); Assert.IsNull(history.EndOwner); }