public void ResolveMandatoryPropertyAccessorData_Expression() { var data = _orderCache.ResolveMandatoryPropertyAccessorData((Order o) => o.OrderNumber); Assert.That(data, Is.Not.Null); Assert.That(data, Is.EqualTo(_orderCache.GetPropertyAccessorData(typeof(Order).FullName + ".OrderNumber"))); }
public void ResolveMandatoryPropertyAccessorData_Expression_Mixin_ViaMixin() { var cacheWithMixins = new PropertyAccessorDataCache(GetTypeDefinition(typeof(TargetClassForPersistentMixin))); var data = cacheWithMixins.ResolveMandatoryPropertyAccessorData((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 ResolveMandatoryPropertyAccessorData_Expression_Mixin_ViaInterface() { var cacheWithMixins = new PropertyAccessorDataCache(GetTypeDefinition(typeof(TargetClassForPersistentMixin))); // ReSharper disable SuspiciousTypeConversion.Global var data = cacheWithMixins.ResolveMandatoryPropertyAccessorData((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"))); }