public void WhenSetMoreSyncThenAddAll()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Synchronize("T1", "T2", "T3", null);
			mapdoc.JoinedSubclasses[0].Synchronize.Select(x => x.table).Should().Have.SameValuesAs("T1", "T2", "T3");
		}
		public void CanSetPersister()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Persister<JoinedSubclassEntityPersister>();
			mapdoc.JoinedSubclasses[0].Persister.Should().Contain("JoinedSubclassEntityPersister");
		}
		public void CanSetPersister()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Persister<JoinedSubclassEntityPersister>();
			Assert.That(mapdoc.JoinedSubclasses[0].Persister, Is.StringContaining("JoinedSubclassEntityPersister"));
		}
Example #4
0
        public void WhenSetSyncWithNullThenDoesNotThrows()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            rc.Executing(x => x.Synchronize(null)).NotThrows();
        }
        public void WhenSetSyncWithNullThenDoesNotThrows()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            Assert.That(() => rc.Synchronize(null), Throws.Nothing);
        }
		public void WhenSetSyncMixedWithNullAndEmptyThenAddOnlyValid()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Synchronize("", "  ATable   ", "     ", null);
			Assert.That(mapdoc.JoinedSubclasses[0].Synchronize.Single().table, Is.EqualTo("ATable"));
		}
		public void WhenSetMoreSyncThenAddAll()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Synchronize("T1", "T2", "T3", null);
			Assert.That(mapdoc.JoinedSubclasses[0].Synchronize.Select(x => x.table), Is.EquivalentTo(new [] {"T1", "T2", "T3"}));
		}
Example #8
0
        public void WhenSetMoreSyncThenAddAll()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            rc.Synchronize("T1", "T2", "T3", null);
            mapdoc.JoinedSubclasses[0].Synchronize.Select(x => x.table).Should().Have.SameValuesAs("T1", "T2", "T3");
        }
        public void WhenSetSyncMixedWithNullAndEmptyThenAddOnlyValid()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            rc.Synchronize("", "  ATable   ", "     ", null);
            Assert.That(mapdoc.JoinedSubclasses[0].Synchronize.Single().table, Is.EqualTo("ATable"));
        }
        public void CanSetPersister()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            rc.Persister <JoinedSubclassEntityPersister>();
            mapdoc.JoinedSubclasses[0].Persister.Should().Contain("JoinedSubclassEntityPersister");
        }
        public void WhenSetMoreSyncThenAddAll()
        {
            var mapdoc = new HbmMapping();
            var rc     = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);

            rc.Synchronize("T1", "T2", "T3", null);
            Assert.That(mapdoc.JoinedSubclasses[0].Synchronize.Select(x => x.table), Is.EquivalentTo(new [] { "T1", "T2", "T3" }));
        }
Example #12
0
        public void SetWrongProxy()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            ActionAssert.Throws <MappingException>(() => mapper.Proxy(typeof(Z)));
        }
Example #13
0
        public void WhenSetExtendsExplicitlyThenSetDifferentBaseType()
        {
            var subClass = typeof(Inherited2);
            var mapdoc   = new HbmMapping {
                assembly = subClass.Assembly.FullName, @namespace = subClass.Namespace
            };
            var mapper = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.Extends(typeof(EntitySimple));
            mapdoc.JoinedSubclasses[0].extends.Should().Be.EqualTo(typeof(EntitySimple).Name);
        }
Example #14
0
        public void CallKeyMapper()
        {
            var subClass        = typeof(Inherited);
            var mapdoc          = new HbmMapping();
            var mapper          = new JoinedSubclassMapper(subClass, mapdoc);
            var keyMapperCalled = false;

            mapper.Key(km => keyMapperCalled = true);

            keyMapperCalled.Should().Be.True();
        }
Example #15
0
        public void SetSelectBeforeUpdate()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.SelectBeforeUpdate(true);

            var hbmEntity = mapdoc.JoinedSubclasses[0];

            hbmEntity.SelectBeforeUpdate.Should().Be(true);
        }
Example #16
0
        public void SetBatchSize()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.BatchSize(10);

            var hbmEntity = mapdoc.JoinedSubclasses[0];

            hbmEntity.BatchSize.Should().Be(10);
        }
Example #17
0
        public void SetDynamicInsert()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.DynamicInsert(true);

            var hbmEntity = mapdoc.JoinedSubclasses[0];

            hbmEntity.DynamicInsert.Should().Be(true);
        }
Example #18
0
        public void SetSqlSubselect()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.Subselect("blah");

            var hbmEntity = mapdoc.JoinedSubclasses[0];

            hbmEntity.Subselect.Should().Not.Be.Null();
            hbmEntity.subselect.Text[0].Should().Be("blah");
        }
Example #19
0
        public void SetLoader()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping();
            var mapper   = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.Loader("blah");

            var hbmEntity = mapdoc.JoinedSubclasses[0];

            hbmEntity.SqlLoader.Should().Not.Be.Null();
            hbmEntity.SqlLoader.queryref.Should().Be("blah");
        }
		public void WhenSetSyncWithNullThenDoesNotThrows()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			Assert.That(() => rc.Synchronize(null), Throws.Nothing);
		}
Example #21
0
        public void JoinedSubclass <TEntity>(Action <IJoinedSubclassMapper <TEntity> > classMapping) where TEntity : class
        {
            var sc = new JoinedSubclassMapper <TEntity>(mapping);

            classMapping(sc);
        }
		public void WhenSetSyncWithNullThenDoesNotThrows()
		{
			var mapdoc = new HbmMapping();
			var rc = new JoinedSubclassMapper(typeof(InheritedSimple), mapdoc);
			rc.Executing(x => x.Synchronize(null)).NotThrows();
		}