public void WhenDefineWithNullThenRegisterValid() { var orm = new ObjectRelationalMapper(); orm.TablePerClass<MyClass>(); orm.TablePerClass<Related>(); orm.NaturalId<MyClass>(x => x.Name, null, x => x.MyComponent, null); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Name)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Related)).Should().Be.False(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.MyComponent)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Any)).Should().Be.False(); }
public void WhenDefineRootEntityThenRegister() { var orm = new ObjectRelationalMapper(); orm.TablePerClass<MyClass>(); orm.TablePerClass<Related>(); orm.NaturalId<MyClass>(x => x.Name, x => x.Related, x => x.MyComponent, x => x.Any); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Name)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Related)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.MyComponent)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass<MyClass>.Property(x => x.Any)).Should().Be.True(); }
public void WhenDefineWithNullThenRegisterValid() { var orm = new ObjectRelationalMapper(); orm.TablePerClass <MyClass>(); orm.TablePerClass <Related>(); orm.NaturalId <MyClass>(x => x.Name, null, x => x.MyComponent, null); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Name)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Related)).Should().Be.False(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.MyComponent)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Any)).Should().Be.False(); }
public void WhenDefineRootEntityThenRegister() { var orm = new ObjectRelationalMapper(); orm.TablePerClass <MyClass>(); orm.TablePerClass <Related>(); orm.NaturalId <MyClass>(x => x.Name, x => x.Related, x => x.MyComponent, x => x.Any); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Name)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Related)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.MyComponent)).Should().Be.True(); orm.IsMemberOfNaturalId(ForClass <MyClass> .Property(x => x.Any)).Should().Be.True(); }