public void GetState_Invalidated_AfterCommit() { var subTransaction = _transaction.CreateSubTransaction(); subTransaction.EnsureDataAvailable(_existingOrder.ID); subTransaction.ExecuteInScope(() => _existingOrder.OrderNumber++); var cachingListener = new DomainObjectStateCache(subTransaction); var stateBeforeChange = cachingListener.GetState(_existingOrder.ID); subTransaction.Commit(); var stateAfterChange = cachingListener.GetState(_existingOrder.ID); Assert.That(stateBeforeChange, Is.EqualTo(StateType.Changed)); Assert.That(stateAfterChange, Is.EqualTo(StateType.Unchanged)); }
public void GetState_IsInvalid() { LifetimeService.DeleteObject(_transaction, _newOrder); Assert.That(_cachingListener.GetState(_newOrder.ID), Is.EqualTo(StateType.Invalid)); }
public StateType GetState(ObjectID objectID) { return(_domainObjectStateCache.GetState(objectID)); }