コード例 #1
0
        public void ResolvePropertyAccessorData_PropertyInformation()
        {
            var propertyinformation = PropertyInfoAdapter.Create(typeof(Order).GetProperty("OrderNumber"));
            var data = _orderCache.ResolvePropertyAccessorData(propertyinformation);

            Assert.That(data, Is.Not.Null);
            Assert.That(data, Is.EqualTo(_orderCache.GetPropertyAccessorData(typeof(Order).FullName + ".OrderNumber")));
        }
コード例 #2
0
        public void ResolvePropertyAccessorData_Expression_Mixin_ViaMixin()
        {
            var cacheWithMixins = new PropertyAccessorDataCache(GetTypeDefinition(typeof(TargetClassForPersistentMixin)));
            var data            = cacheWithMixins.ResolvePropertyAccessorData((TargetClassForPersistentMixin t) => (Mixin.Get <MixinAddingPersistentProperties>(t).PersistentProperty));

            Assert.That(data, Is.Not.Null);
            Assert.That(data, Is.EqualTo(cacheWithMixins.GetPropertyAccessorData(typeof(MixinAddingPersistentProperties).FullName + ".PersistentProperty")));
        }
コード例 #3
0
        public void ResolvePropertyAccessorData_PropertyInformation_Mixin_ViaMixin()
        {
            var cacheWithMixins     = new PropertyAccessorDataCache(GetTypeDefinition(typeof(TargetClassForPersistentMixin)));
            var propertyinformation = PropertyInfoAdapter.Create(typeof(MixinAddingPersistentProperties).GetProperty("PersistentProperty"));
            var data = cacheWithMixins.ResolvePropertyAccessorData(propertyinformation);

            Assert.That(data, Is.Not.Null);
            Assert.That(data, Is.EqualTo(cacheWithMixins.GetPropertyAccessorData(typeof(MixinAddingPersistentProperties).FullName + ".PersistentProperty")));
        }
コード例 #4
0
        public void ResolvePropertyAccessorData_Expression_Mixin_ViaInterface()
        {
            var cacheWithMixins = new PropertyAccessorDataCache(GetTypeDefinition(typeof(TargetClassForPersistentMixin)));
// ReSharper disable SuspiciousTypeConversion.Global
            var data = cacheWithMixins.ResolvePropertyAccessorData((TargetClassForPersistentMixin t) => ((IMixinAddingPersistentProperties)t).PersistentProperty);

// ReSharper restore SuspiciousTypeConversion.Global

            Assert.That(data, Is.Not.Null);
            Assert.That(data, Is.EqualTo(cacheWithMixins.GetPropertyAccessorData(typeof(MixinAddingPersistentProperties).FullName + ".PersistentProperty")));
        }