public void WhenSetMoreSyncThenAddAll() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Synchronize("T1", "T2", "T3", null); mapdoc.UnionSubclasses[0].Synchronize.Select(x => x.table).Should().Have.SameValuesAs("T1", "T2", "T3"); }
public void WhenSetSyncWithNullThenDoesNotThrows() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); Assert.That(() => rc.Synchronize(null), Throws.Nothing); }
public void WhenSetSyncMixedWithNullAndEmptyThenAddOnlyValid() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Synchronize("", " ATable ", " ", null); mapdoc.UnionSubclasses[0].Synchronize.Single().table.Should().Be("ATable"); }
public void CanSetPersister() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Persister<UnionSubclassEntityPersister>(); mapdoc.UnionSubclasses[0].Persister.Should().Contain("UnionSubclassEntityPersister"); }
public void CanSetPersister() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Persister<UnionSubclassEntityPersister>(); Assert.That(mapdoc.UnionSubclasses[0].Persister, Is.StringContaining("UnionSubclassEntityPersister")); }
public void WhenSetSyncWithNullThenDoesNotThrows() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Executing(x => x.Synchronize(null)).NotThrows(); }
public void WhenSetMoreSyncThenAddAll() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Synchronize("T1", "T2", "T3", null); Assert.That(mapdoc.UnionSubclasses[0].Synchronize.Select(x => x.table), Is.EquivalentTo(new [] {"T1", "T2", "T3"})); }
public void WhenSetSyncMixedWithNullAndEmptyThenAddOnlyValid() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Synchronize("", " ATable ", " ", null); Assert.That(mapdoc.UnionSubclasses[0].Synchronize.Single().table, Is.EqualTo("ATable")); }
public void CanSetAbstractAttributeOnConcreteClass() { var mapping = new HbmMapping(); var mapper = new UnionSubclassMapper(typeof(InventoryItem), mapping); Assert.That(mapping.UnionSubclasses[0].abstractSpecified, Is.False); Assert.That(mapping.UnionSubclasses[0].@abstract, Is.False); }
public void CanSetAbstractAttributeOnAbstractClass() { var mapping = new HbmMapping(); var mapper = new UnionSubclassMapper(typeof(Item), mapping); Assert.That(mapping.UnionSubclasses[0].abstractSpecified, Is.True); Assert.That(mapping.UnionSubclasses[0].@abstract, Is.True); }
public void SetWrongProxy() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); ActionAssert.Throws <MappingException>(() => mapper.Proxy(typeof(Z))); }
public void WhenSetMoreSyncThenAddAll() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Synchronize("T1", "T2", "T3", null); Assert.That(mapdoc.UnionSubclasses[0].Synchronize.Select(x => x.table), Is.EquivalentTo(new [] { "T1", "T2", "T3" })); }
public void CanSetPersister() { var mapdoc = new HbmMapping(); var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc); rc.Persister <UnionSubclassEntityPersister>(); Assert.That(mapdoc.UnionSubclasses[0].Persister, Does.Contain("UnionSubclassEntityPersister")); }
public void SetWrongProxy() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); Executing.This(() => mapper.Proxy(typeof(Z))).Should().Throw <MappingException>(); }
public void SetSelectBeforeUpdate() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.SelectBeforeUpdate(true); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.SelectBeforeUpdate.Should().Be(true); }
public void SetDynamicInsert() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.DynamicInsert(true); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.DynamicInsert.Should().Be(true); }
public void SetBatchSize() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.BatchSize(10); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.BatchSize.Should().Be(10); }
public void SetProxy() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.Proxy(subClass); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.Proxy.Should().Contain("Inherited"); }
public void SetEntityName() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.EntityName("pepe"); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.EntityName.Should().Be("pepe"); }
public void SetLoader() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.Loader("blah"); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.SqlLoader.Should().Not.Be.Null(); hbmEntity.SqlLoader.queryref.Should().Be("blah"); }
public void SetSqlSubselect() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.Subselect("blah"); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.Subselect.Should().Not.Be.Null(); hbmEntity.subselect.Text[0].Should().Be("blah"); }
public void SetLazy() { var subClass = typeof(Inherited); var mapdoc = new HbmMapping(); var mapper = new UnionSubclassMapper(subClass, mapdoc); mapper.Lazy(true); var hbmEntity = mapdoc.UnionSubclasses[0]; hbmEntity.UseLazy.Should().Not.Have.Value(); mapper.Lazy(false); hbmEntity.UseLazy.Should().Be(false); }