Example #1
0
        public void Initialize()
        {
            bool includeBaseProperties  = BooleanObjectMother.GetRandomBoolean();
            bool includeMixinProperties = BooleanObjectMother.GetRandomBoolean();
            var  propertyFinder         = new StubPropertyFinderBase(
                typeof(ClassWithDifferentProperties), includeBaseProperties, includeMixinProperties, _persistentMixinFinderStub);

            Assert.That(propertyFinder.Type, Is.SameAs(typeof(ClassWithDifferentProperties)));
            Assert.That(propertyFinder.IncludeBaseProperties, Is.EqualTo(includeBaseProperties));
            Assert.That(propertyFinder.IncludeMixinProperties, Is.EqualTo(includeMixinProperties));
        }
Example #2
0
        public void FindPropertyInfos_ForClassWithInterface()
        {
            var propertyFinder = new StubPropertyFinderBase(typeof(ClassWithInterface), false, false, _persistentMixinFinderStub);

            Assert.That(
                propertyFinder.FindPropertyInfos(),
                Is.EquivalentTo(
                    new[]
            {
                GetProperty(typeof(ClassWithInterface), "Property"),
                GetProperty(typeof(ClassWithInterface), "ImplicitProperty"),
                GetProperty(typeof(ClassWithInterface), "Remotion.Data.DomainObjects.UnitTests.Mapping.TestDomain.Integration.ReflectionBasedMappingSample.IInterfaceWithProperties.ExplicitManagedProperty")
            }));
        }
Example #3
0
        public void FindPropertyInfos_ForDerivedClass()
        {
            var propertyFinder = new StubPropertyFinderBase(typeof(ClassWithDifferentProperties), false, false, _persistentMixinFinderStub);

            Assert.That(
                propertyFinder.FindPropertyInfos(),
                Is.EquivalentTo(
                    new[]
            {
                GetProperty(typeof(ClassWithDifferentProperties), "Int32"),
                GetProperty(typeof(ClassWithDifferentProperties), "String"),
                GetProperty(typeof(ClassWithDifferentProperties), "UnidirectionalOneToOne"),
                GetProperty(typeof(ClassWithDifferentProperties), "PrivateString")
            }));
        }
Example #4
0
        public void FindPropertyInfos_WithMixins_ForDerived()
        {
            var persistentMixinFinder = new PersistentMixinFinder(typeof(TargetClassB));
            var propertyFinder        = new StubPropertyFinderBase(typeof(TargetClassB), false, true, persistentMixinFinder);

            Assert.That(
                propertyFinder.FindPropertyInfos(),
                Is.EquivalentTo(
                    new[]
            {
                GetProperty(typeof(TargetClassB), "P3"),
                GetProperty(typeof(TargetClassB), "P4"),
                GetProperty(typeof(MixinB), "P6"),
                GetProperty(typeof(MixinE), "P9"),
            }));
        }
Example #5
0
        public void FindPropertyInfos_WithMixins_ForNonInheritanceRoot()
        {
            var persistentMixinFinder = new PersistentMixinFinder(typeof(TargetClassA));
            var propertyFinder        = new StubPropertyFinderBase(typeof(TargetClassA), false, true, persistentMixinFinder);

            Assert.That(
                propertyFinder.FindPropertyInfos(),
                Is.EquivalentTo(
                    new[]
            {
                GetProperty(typeof(TargetClassA), "P1"),
                GetProperty(typeof(TargetClassA), "P2"),
                GetProperty(typeof(MixinA), "P5"),
                GetProperty(typeof(MixinC), "P7"),
                GetProperty(typeof(MixinD), "P8"),
            }));
        }
Example #6
0
        public void FindPropertyInfos_ForNonDomainObject()
        {
            var propertyFinder = new StubPropertyFinderBase(typeof(int), true, false, _persistentMixinFinderStub);

            Assert.That(propertyFinder.FindPropertyInfos(), Is.Empty);
        }
Example #7
0
        public void FindPropertyInfos_ForDomainObjectType()
        {
            var propertyFinder = new StubPropertyFinderBase(typeof(DomainObject), true, false, _persistentMixinFinderStub);

            Assert.That(propertyFinder.FindPropertyInfos(), Is.Not.Empty.And.Member(PropertyInfoAdapter.Create(typeof(DomainObject).GetProperty("ID"))));
        }