public void WhenDefineMoreJoinsWithSameIdThenUseSameJoinMapperInstance()
        {
            var         mapdoc             = new HbmMapping();
            var         mapper             = new SubclassMapper(typeof(Inherited), mapdoc);
            IJoinMapper firstCallInstance  = null;
            IJoinMapper secondCallInstance = null;

            mapper.Join("T1", x => firstCallInstance  = x);
            mapper.Join("T1", x => secondCallInstance = x);

            Assert.That(firstCallInstance, Is.SameAs(secondCallInstance));
            var hbmClass = mapdoc.SubClasses[0];

            Assert.That(hbmClass.Joins.Count(), Is.EqualTo(1));
        }
        public void WhenDefineMoreJoinsWithSameIdThenUseSameJoinMapperInstance()
        {
            var         mapdoc             = new HbmMapping();
            var         mapper             = new ClassMapper(typeof(MyClass), mapdoc, For <MyClass> .Property(x => x.Id));
            IJoinMapper firstCallInstance  = null;
            IJoinMapper secondCallInstance = null;

            mapper.Join("T1", x => firstCallInstance  = x);
            mapper.Join("T1", x => secondCallInstance = x);

            Assert.That(firstCallInstance, Is.SameAs(secondCallInstance));
            var hbmClass = mapdoc.RootClasses[0];

            Assert.That(hbmClass.Joins.Count(), Is.EqualTo(1));
        }
        public void WhenDefineMoreJoinsWithSameIdThenUseSameJoinMapperInstance()
        {
            var         mapdoc             = new HbmMapping();
            var         mapper             = new SubclassMapper(typeof(Inherited), mapdoc);
            IJoinMapper firstCallInstance  = null;
            IJoinMapper secondCallInstance = null;

            mapper.Join("T1", x => firstCallInstance  = x);
            mapper.Join("T1", x => secondCallInstance = x);

            firstCallInstance.Should().Be.SameInstanceAs(secondCallInstance);
            var hbmClass = mapdoc.SubClasses[0];

            hbmClass.Joins.Should().Have.Count.EqualTo(1);
        }