コード例 #1
0
        public void GetRelationEndPointWithoutLoading_NullRealObjectEndPoint()
        {
            var endPointDefinition =
                Configuration.GetTypeDefinition(typeof(OrderTicket)).GetRelationEndPointDefinition(typeof(OrderTicket).FullName + ".Order");
            var relationEndPointID = RelationEndPointID.Create(null, endPointDefinition);

            var result = _relationEndPointManager.GetRelationEndPointWithoutLoading(relationEndPointID);

            Assert.That(result, Is.TypeOf(typeof(NullRealObjectEndPoint)));
            Assert.That(result.Definition, Is.EqualTo(endPointDefinition));
        }
コード例 #2
0
        public void OrderTicket()
        {
            var orderTicketContainer = TestDataContainerObjectMother.CreateOrderTicket1DataContainer();

            _relationEndPointManager.RegisterEndPointsForDataContainer(orderTicketContainer);

            Assert.AreEqual(2, _relationEndPointManager.RelationEndPoints.Count, "Count");

            var expectedEndPointIDForOrderTicket = RelationEndPointID.Create(DomainObjectIDs.OrderTicket1,
                                                                             "Remotion.Data.DomainObjects.UnitTests.TestDomain.OrderTicket.Order");

            Assert.AreEqual(expectedEndPointIDForOrderTicket,
                            _relationEndPointManager.GetRelationEndPointWithoutLoading(expectedEndPointIDForOrderTicket).ID, "RelationEndPointID for OrderTicket");

            Assert.AreEqual(
                DomainObjectIDs.Order1,
                ((IObjectEndPoint)_relationEndPointManager.GetRelationEndPointWithoutLoading(expectedEndPointIDForOrderTicket)).OppositeObjectID,
                "OppositeObjectID for OrderTicket");

            var expectedEndPointIDForOrder = RelationEndPointID.Create(DomainObjectIDs.Order1,
                                                                       "Remotion.Data.DomainObjects.UnitTests.TestDomain.Order.OrderTicket");

            Assert.AreEqual(expectedEndPointIDForOrder,
                            _relationEndPointManager.GetRelationEndPointWithoutLoading(expectedEndPointIDForOrder).ID, "RelationEndPointID for Order");

            Assert.AreEqual(
                DomainObjectIDs.OrderTicket1,
                ((IObjectEndPoint)_relationEndPointManager.GetRelationEndPointWithoutLoading(expectedEndPointIDForOrder)).OppositeObjectID,
                "OppositeObjectID for Order");
        }