public void SetCollectionTypeByWrongTypeShouldThrow()
        {
            var hbm    = new HbmBag();
            var mapper = new BagMapper(typeof(Animal), typeof(Animal), hbm);

            ActionAssert.Throws <ArgumentNullException>(() => mapper.Type(null));
            ActionAssert.Throws <ArgumentOutOfRangeException>(() => mapper.Type(typeof(object)));
        }
Beispiel #2
0
        public void SetCollectionTypeByWrongTypeShouldThrow()
        {
            var hbm    = new HbmBag();
            var mapper = new BagMapper(typeof(Animal), typeof(Animal), hbm);

            Executing.This(() => mapper.Type(null)).Should().Throw <ArgumentNullException>();
            Executing.This(() => mapper.Type(typeof(object))).Should().Throw <ArgumentOutOfRangeException>();
        }
        public void SetCollectionTypeByType()
        {
            var hbm    = new HbmBag();
            var mapper = new BagMapper(typeof(Animal), typeof(Animal), hbm);

            mapper.Type(typeof(FakeUserCollectionType));
            hbm.CollectionType.Should().Contain("FakeUserCollectionType");
        }
 public void SetCollectionTypeByType()
 {
     var hbm = new HbmBag();
     var mapper = new BagMapper(typeof(Animal), typeof(Animal), hbm);
     mapper.Type(typeof(FakeUserCollectionType));
     hbm.CollectionType.Should().Contain("FakeUserCollectionType");
 }
 public void SetCollectionTypeByWrongTypeShouldThrow()
 {
     var hbm = new HbmBag();
     var mapper = new BagMapper(typeof(Animal), typeof(Animal), hbm);
     ActionAssert.Throws<ArgumentNullException>(() => mapper.Type(null));
     ActionAssert.Throws<ArgumentOutOfRangeException>(() => mapper.Type(typeof(object)));
 }