コード例 #1
0
        public void SetDataFromSubTransaction_InvalidDefinition()
        {
            var otherID = RelationEndPointObjectMother.CreateRelationEndPointID(DomainObjectIDs.Order1, "OrderItems");
            var source  = RelationEndPointObjectMother.CreateCollectionEndPoint(otherID, new DomainObject[0]);

            _endPoint.SetDataFromSubTransaction(source);
        }
コード例 #2
0
        public void SetDataFromSubTransaction()
        {
            var source = RelationEndPointObjectMother.CreateCollectionEndPoint(_customerEndPointID, new[] { _order3 });

            _loadStateMock.Stub(stub => stub.HasChanged()).Return(false);
            _loadStateMock.Expect(mock => mock.SetDataFromSubTransaction(_endPoint, CollectionEndPointTestHelper.GetLoadState(source)));
            _loadStateMock.Replay();

            _collectionManagerMock.Stub(stub => stub.HasCollectionReferenceChanged()).Return(false);

            _endPoint.SetDataFromSubTransaction(source);

            _loadStateMock.VerifyAllExpectations();
        }
コード例 #3
0
        public void SetDataFromSubTransaction_DoesNotTouchEndPoint_WhenSourceUntouched_AndTargetUnchanged()
        {
            var source = RelationEndPointObjectMother.CreateCollectionEndPoint(_customerEndPointID, new[] { _order3 });

            _loadStateMock.Stub(stub => stub.HasChanged()).Return(false);
            _loadStateMock.Stub(stub => stub.SetDataFromSubTransaction(_endPoint, CollectionEndPointTestHelper.GetLoadState(source)));
            _loadStateMock.Replay();

            _collectionManagerMock.Stub(stub => stub.HasCollectionReferenceChanged()).Return(false);

            Assert.That(_endPoint.HasBeenTouched, Is.False);

            _endPoint.SetDataFromSubTransaction(source);

            Assert.That(_endPoint.HasBeenTouched, Is.False);
        }