public void WhenExplicitDeclaredThenRecognizeVerion() { var orm = new ObjectRelationalMapper(); orm.VersionProperty<MyClass>(myclass => myclass.Version); orm.IsVersion(typeof (MyClass).GetProperty("Version")).Should().Be.True(); }
public void WhenExplicitDeclaredInBaseClassThenRecognizeVerion() { var orm = new ObjectRelationalMapper(); orm.VersionProperty <MyClass>(myclass => myclass.Version); orm.IsVersion(typeof(Inherited).GetProperty("Version")).Should().Be.True(); }
public void WhenVersionPropertyDefinedOnInterfaceThenRecognizeItOnConcreteClass() { var orm = new ObjectRelationalMapper(); orm.TablePerClass<MyVersionedEntityOnInterface>(); orm.VersionProperty<IVersionedEntity>(versionedEntity => versionedEntity.Version); orm.IsVersion(ForClass<MyVersionedEntityOnInterface>.Property(e => e.Version)).Should().Be.True(); }
public void WhenVersionPropertyDefinedOnInterfaceThenRecognizeItOnConcreteClass() { var orm = new ObjectRelationalMapper(); orm.TablePerClass <MyVersionedEntityOnInterface>(); orm.VersionProperty <IVersionedEntity>(versionedEntity => versionedEntity.Version); orm.IsVersion(ForClass <MyVersionedEntityOnInterface> .Property(e => e.Version)).Should().Be.True(); }
public void WhenPatternMatchThenRecognizeVerion() { var versionPropertyInfo = typeof(MyClass).GetProperty("Version"); var orm = new ObjectRelationalMapper(); var versionPattern = new Mock<IPattern<MemberInfo>>(); versionPattern.Setup(vp => vp.Match(It.Is<MemberInfo>(mi => mi == versionPropertyInfo))).Returns(true); orm.Patterns.Versions.Add(versionPattern.Object); orm.IsVersion(versionPropertyInfo).Should().Be.True(); }
public void WhenPatternMatchThenRecognizeVerion() { var versionPropertyInfo = typeof(MyClass).GetProperty("Version"); var orm = new ObjectRelationalMapper(); var versionPattern = new Mock <IPattern <MemberInfo> >(); versionPattern.Setup(vp => vp.Match(It.Is <MemberInfo>(mi => mi == versionPropertyInfo))).Returns(true); orm.Patterns.Versions.Add(versionPattern.Object); orm.IsVersion(versionPropertyInfo).Should().Be.True(); }