public void CanSetParentAccessor() { var mapdoc = new HbmMapping(); var component = new HbmComponent(); var mapper = new ComponentMapper(component, typeof(Name), ForClass<Person>.Property(p => p.Name), mapdoc); mapper.Parent(typeof(Address).GetProperty("Parent"), pm=> pm.Access(Accessor.Field)); component.Parent.access.Should().Contain("field"); }
public void CanSetOptimisticLock() { var mapdoc = new HbmMapping(); var component = new HbmComponent(); var mapper = new ComponentMapper(component, typeof(Name), ForClass<Person>.Property(p => p.Name), mapdoc); mapper.OptimisticLock(false); component.optimisticlock.Should().Be.False(); }
public void CanSetInsert() { var mapdoc = new HbmMapping(); var component = new HbmComponent(); var mapper = new ComponentMapper(component, typeof(Name), ForClass<Person>.Property(p => p.Name), mapdoc); mapper.Insert(false); component.insert.Should().Be.False(); }
public void CanSetLazy() { var mapdoc = new HbmMapping(); var component = new HbmComponent(); var mapper = new ComponentMapper(component, typeof(Name), ForClass<Person>.Property(p => p.Name), mapdoc); mapper.Lazy(true); component.lazy.Should().Be.True(); }
public void CallingParentSetTheParentNode() { var mapdoc = new HbmMapping(); var component = new HbmComponent(); var mapper = new ComponentMapper(component, typeof(Name), ForClass<Person>.Property(p => p.Name), mapdoc); mapper.Parent(typeof (Address).GetProperty("Parent")); component.Parent.Should().Not.Be.Null(); component.Parent.name.Should().Be.EqualTo("Parent"); }