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"))); }
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"))); }
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"))); }
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"))); }