public void GetPropertyObjects_OneOne_RealSide()
        {
            var classDefinition    = MappingConfiguration.Current.GetTypeDefinition(typeof(Computer));
            var propertyIdentifier = GetPropertyIdentifier(classDefinition, "Employee");

            var propertyObjects = PropertyAccessorData.GetPropertyDefinitionObjects(classDefinition, propertyIdentifier);

            Assert.That(propertyObjects.Item2, Is.Not.Null);
            Assert.That(propertyObjects.Item2.ClassDefinition, Is.SameAs(classDefinition));
            Assert.That(propertyObjects.Item2.PropertyName, Is.EqualTo(propertyIdentifier));
        }
        public void GetPropertyObjects_CollectionProperty_BackReference()
        {
            var classDefinition    = MappingConfiguration.Current.GetTypeDefinition(typeof(Company));
            var propertyIdentifier = GetPropertyIdentifier(classDefinition, "IndustrialSector");

            var propertyObjects = PropertyAccessorData.GetPropertyDefinitionObjects(classDefinition, propertyIdentifier);

            Assert.That(propertyObjects.Item2, Is.Not.Null);
            Assert.That(propertyObjects.Item2.ClassDefinition, Is.SameAs(classDefinition));
            Assert.That(propertyObjects.Item2.PropertyName, Is.EqualTo(propertyIdentifier));
        }
        public void GetPropertyObjects_StringProperty()
        {
            var classDefinition    = MappingConfiguration.Current.GetTypeDefinition(typeof(IndustrialSector));
            var propertyIdentifier = GetPropertyIdentifier(classDefinition, "Name");

            var propertyObjects = PropertyAccessorData.GetPropertyDefinitionObjects(classDefinition, propertyIdentifier);

            Assert.That(propertyObjects.Item1, Is.Not.Null);
            Assert.That(propertyObjects.Item1.ClassDefinition, Is.SameAs(classDefinition));
            Assert.That(propertyObjects.Item1.PropertyName, Is.EqualTo(propertyIdentifier));
            Assert.That(propertyObjects.Item2, Is.Null);
        }
 public void GetPropertyObjects_ThrowsOnInvalidPropertyID2()
 {
     PropertyAccessorData.GetPropertyDefinitionObjects(
         MappingConfiguration.Current.GetTypeDefinition(typeof(Company)),
         "Remotion.Data.DomainObjects.UnitTests.TestDomain.IndustrialSector.Companies");
 }
 public void GetPropertyObjects_ThrowsOnInvalidPropertyID1()
 {
     PropertyAccessorData.GetPropertyDefinitionObjects(
         MappingConfiguration.Current.GetTypeDefinition(typeof(IndustrialSector)),
         "Bla");
 }