Example #1
0
        public void SetFetchMode()
        {
            var mapdoc = new HbmMapping();
            var hbm    = new HbmMap();
            var mapper = new MapMapper(typeof(Animal), typeof(Animal), typeof(string), hbm, mapdoc);

            mapper.Fetch(CollectionFetchMode.Subselect);
            hbm.fetch.Should().Be(HbmCollectionFetchMode.Subselect);
            hbm.fetchSpecified.Should().Be.True();
            mapper.Fetch(CollectionFetchMode.Join);
            hbm.fetch.Should().Be(HbmCollectionFetchMode.Join);
            hbm.fetchSpecified.Should().Be.True();
            mapper.Fetch(CollectionFetchMode.Select);
            hbm.fetch.Should().Be(HbmCollectionFetchMode.Select);
            hbm.fetchSpecified.Should().Be.False();
        }