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");
		}
Example #2
0
        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"}));
		}
Example #8
0
        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"));
        }
Example #9
0
        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);
        }
Example #10
0
        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 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");
        }
Example #12
0
        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 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);
		}
Example #14
0
        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 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);
		}
Example #16
0
        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"));
        }
Example #17
0
        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>();
        }
Example #18
0
        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);
        }
Example #19
0
        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);
        }
Example #20
0
        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);
        }
Example #21
0
        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");
        }
Example #22
0
        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");
        }
Example #23
0
        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");
        }
Example #24
0
        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");
        }
Example #25
0
        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);
        }
		public void WhenSetSyncWithNullThenDoesNotThrows()
		{
			var mapdoc = new HbmMapping();
			var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc);
			Assert.That(() => rc.Synchronize(null), Throws.Nothing);
		}
		public void WhenSetSyncWithNullThenDoesNotThrows()
		{
			var mapdoc = new HbmMapping();
			var rc = new UnionSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Executing(x => x.Synchronize(null)).NotThrows();
		}