public void GroupAndRegisterRelatedObjects_WithNullRelatedObject()
        {
            var endPointDefinition = GetEndPointDefinition(typeof(OrderTicket), "Order");

            _agent.GroupAndRegisterRelatedObjects(
                endPointDefinition,
                new[] { _originatingOrderTicketData1 },
                new[] { LoadedObjectDataObjectMother.CreateNullLoadedObjectDataWithDataSourceData() });
        }
Exemple #2
0
        public void GroupAndRegisterRelatedObjects_WithNullRelatedObject_AndMandatoryRelation()
        {
            var endPointDefinition = GetEndPointDefinition(typeof(Order), "OrderTicket");

            Assert.That(endPointDefinition.IsMandatory, Is.True);
            var originatingOrderData = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(DomainObjectIDs.Order1);

            _agent.GroupAndRegisterRelatedObjects(
                endPointDefinition,
                new[] { originatingOrderData },
                new[] { LoadedObjectDataObjectMother.CreateNullLoadedObjectDataWithDataSourceData() });
        }
        public void GroupAndRegisterRelatedObjects_WithNullRelatedObject()
        {
            var endPointDefinition = GetEndPointDefinition(typeof(Customer), "Orders");

            var collectionEndPointMock = MockRepository.GenerateStrictMock <ICollectionEndPoint> ();

            ExpectGetEndPoint(_originatingCustomer1.ID, endPointDefinition, _virtualEndPointProviderMock, collectionEndPointMock, false);
            collectionEndPointMock.Expect(mock => mock.MarkDataComplete(new DomainObject[0]));

            _virtualEndPointProviderMock.Replay();
            collectionEndPointMock.Replay();

            _agent.GroupAndRegisterRelatedObjects(
                endPointDefinition,
                new[] { _originatingCustomerData1 },
                new[] { LoadedObjectDataObjectMother.CreateNullLoadedObjectDataWithDataSourceData() });

            _virtualEndPointProviderMock.VerifyAllExpectations();
            collectionEndPointMock.VerifyAllExpectations();
        }
Exemple #4
0
        public void GroupAndRegisterRelatedObjects_WithNullRelatedObject_AndNonMandatoryRelation()
        {
            var endPointDefinition = GetEndPointDefinition(typeof(Employee), "Computer");

            Assert.That(endPointDefinition.IsMandatory, Is.False);

            var endPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint> ();

            ExpectGetEndPoint(_originatingEmployee1.ID, endPointDefinition, _virtualEndPointProviderMock, endPointMock, false);
            endPointMock.Expect(mock => mock.MarkDataComplete(null));

            _virtualEndPointProviderMock.Replay();
            endPointMock.Replay();

            _agent.GroupAndRegisterRelatedObjects(
                endPointDefinition,
                new[] { _originatingEmployeeData1 },
                new[] { LoadedObjectDataObjectMother.CreateNullLoadedObjectDataWithDataSourceData() });

            _virtualEndPointProviderMock.VerifyAllExpectations();
            endPointMock.VerifyAllExpectations();
        }