Beispiel #1
0
        public void WhenAssociatingAnEntity_ItsRelatedEntityNameShouldBePartOfTheAssociation()
        {
            var testEntityToBeAssociated = new TestEntityToBeAssociated();
            var testAssociatedEntity     = new TestAssociatedEntity();

            var association =
                Associate.ThisEntity(testEntityToBeAssociated)
                .With(testAssociatedEntity);

            Assert.Equal("test_associatedentity", association.RelatedEntities.Single().Value);
        }
Beispiel #2
0
        public void WhenAssociatingAnEntity_ItsIdShouldBePartOfTheAssociation()
        {
            var testEntityToBeAssociated = new TestEntityToBeAssociated();
            var testAssociatedEntity     = new TestAssociatedEntity();

            var association =
                Associate.ThisEntity(testEntityToBeAssociated)
                .With(testAssociatedEntity);

            Assert.Equal(testEntityToBeAssociated.Id, association.EntityId);
        }
Beispiel #3
0
        public void WhenAssociatingAnEntity_ItsEntityNameShouldBePartOfTheAssociation()
        {
            var testEntityToBeAssociated = new TestEntityToBeAssociated();
            var testAssociatedEntity     = new TestAssociatedEntity();

            var association =
                Associate.ThisEntity(testEntityToBeAssociated)
                .With(testAssociatedEntity);

            Assert.Equal("test_entitytobeassociated", association.EntityName);
        }