public override void SetUp() { base.SetUp(); _owningOrder = DomainObjectIDs.Order1.GetObject <Order> (); _endPointID = RelationEndPointID.Resolve(_owningOrder, o => o.OrderItems); _collectionEndPointMock = MockRepository.GenerateStrictMock <ICollectionEndPoint>(); StubCollectionEndPoint(_collectionEndPointMock, TestableClientTransaction, _owningOrder); _virtualEndPointProviderStub = MockRepository.GenerateStub <IVirtualEndPointProvider> (); _virtualEndPointProviderStub .Stub(stub => stub.GetOrCreateVirtualEndPoint(_endPointID)) .Return(_collectionEndPointMock); _endPointDataStub = MockRepository.GenerateStub <IDomainObjectCollectionData>(); _endPointDataDecorator = new ReadOnlyCollectionDataDecorator(_endPointDataStub); _commandStub = MockRepository.GenerateStub <IDataManagementCommand>(); _nestedCommandMock = MockRepository.GenerateMock <IDataManagementCommand> (); _nestedCommandMock.Stub(stub => stub.GetAllExceptions()).Return(new Exception[0]); _expandedCommandFake = new ExpandedCommand(_nestedCommandMock); _delegatingData = new EndPointDelegatingCollectionData(_endPointID, _virtualEndPointProviderStub); _orderItem1 = DomainObjectIDs.OrderItem1.GetObject <OrderItem>(); _orderItem2 = DomainObjectIDs.OrderItem2.GetObject <OrderItem>(); ClientTransactionScope.EnterNullScope(); // no active transaction }
public void HasCurrentFalseViaNullTransaction() { using (ClientTransactionScope.EnterNullScope()) { Assert.That(ClientTransactionScope.HasCurrentTransaction, Is.False); } }
public void SearchAvailableObjects_NoTransaction() { using (ClientTransactionScope.EnterNullScope()) { _service.Search(null, _property, new DefaultSearchArguments(_stubbedQueryID)); } }
public void NullTransaction_ForCloneTransaction() { using (ClientTransactionScope.EnterNullScope()) { _cloner.CreateValueClone(_boundSource); } }
public void ExecuteSingle_NoActiveClientTransaction() { using (ClientTransactionScope.EnterNullScope()) { _queryExecutor.ExecuteSingle <Order> (_someQueryModel, false); } }
public void ExecuteCollection_NoActiveClientTransaction() { using (ClientTransactionScope.EnterNullScope()) { _queryExecutor.ExecuteCollection <Order> (_someQueryModel); } }
public void ExecuteScalar_NoActiveClientTransaction() { using (ClientTransactionScope.EnterNullScope()) { _queryExecutor.ExecuteScalar <int> (_someQueryModel); } }
public void NoAutoInitializationOfCurrent() { using (ClientTransactionScope.EnterNullScope()) { Assert.That(ClientTransactionScope.HasCurrentTransaction, Is.False); Dev.Null = ClientTransactionScope.CurrentTransaction; } }
public void Search_NoCurrentTransaction() { using (ClientTransactionScope.EnterNullScope()) { var property = GetBusinessObjectProperty(typeof(OppositeBidirectionalBindableDomainObject), "OppositeSampleObject"); _service.Search(null, property, null); } }
public void ToCustomCollection_WithoutTransaction() { using (ClientTransactionScope.EnterNullScope()) { var collection = _resultWithCustomType.ToCustomCollection(); Assert.That(collection, Is.InstanceOf(typeof(OrderCollection))); Assert.That(collection, Is.EqualTo(new[] { _order1, _order3, _order4 })); } }
public void EnterNullScopeSetsNullTransaction() { using (ClientTransaction.CreateRootTransaction().EnterNonDiscardingScope()) { Assert.That(ClientTransactionScope.HasCurrentTransaction, Is.True); using (ClientTransactionScope.EnterNullScope()) { Assert.That(ClientTransactionScope.HasCurrentTransaction, Is.False); } Assert.That(ClientTransactionScope.HasCurrentTransaction, Is.True); } }
public void GetOppositeObject() { RealObjectEndPointTestHelper.SetOppositeObjectID(_endPoint, DomainObjectIDs.Order1); DomainObject oppositeObject; using (ClientTransactionScope.EnterNullScope()) { oppositeObject = _endPoint.GetOppositeObject(); } Assert.That(oppositeObject, Is.SameAs(LifetimeService.GetObjectReference(TestableClientTransaction, DomainObjectIDs.Order1))); Assert.That(oppositeObject.State, Is.EqualTo(StateType.NotLoadedYet), "Data has not been loaded"); }
public void ClientTransactionCurrentIdenticalToScopeCurrentButNullOnEmptyScope() { ClientTransaction clientTransaction1 = ClientTransaction.CreateRootTransaction(); ClientTransaction clientTransaction2 = ClientTransaction.CreateRootTransaction(); Assert.That(ClientTransaction.Current, Is.SameAs(ClientTransactionScope.CurrentTransaction)); using (clientTransaction1.EnterDiscardingScope()) { Assert.That(ClientTransaction.Current, Is.SameAs(ClientTransactionScope.CurrentTransaction)); using (clientTransaction2.EnterDiscardingScope()) { Assert.That(ClientTransaction.Current, Is.SameAs(ClientTransactionScope.CurrentTransaction)); } Assert.That(ClientTransaction.Current, Is.SameAs(ClientTransactionScope.CurrentTransaction)); } Assert.That(ClientTransaction.Current, Is.SameAs(ClientTransactionScope.CurrentTransaction)); using (ClientTransactionScope.EnterNullScope()) { Assert.That(ClientTransaction.Current, Is.Null); } }