public void WhenConfigureIdMoreThanOnceThenUseSameMapper() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); ICollectionIdMapper firstInstance = null; ICollectionIdMapper secondInstance = null; mapper.Id(x => firstInstance = x); mapper.Id(x => secondInstance = x); firstInstance.Should().Be.SameInstanceAs(secondInstance); }
public void WhenConfigureIdMoreThanOnceThenUseSameMapper() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); ICollectionIdMapper firstInstance = null; ICollectionIdMapper secondInstance = null; mapper.Id(x => firstInstance = x); mapper.Id(x => secondInstance = x); Assert.That(firstInstance, Is.SameAs(secondInstance)); }
public void WhenConfigureIdThenCallMapper() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); mapper.Id(x => x.Column("catchMe")); hbm.collectionid.Columns.Single().name.Should().Be("catchMe"); }
public void WhenConfigureIdThenCallMapper() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); mapper.Id(x => x.Column("catchMe")); Assert.That(hbm.collectionid.Columns.Single().name, Is.EqualTo("catchMe")); }