Beispiel #1
0
        public void SetCollectionTypeByWrongTypeShouldThrow()
        {
            var hbm    = new HbmSet();
            var mapper = new SetMapper(typeof(Animal), typeof(Animal), hbm);

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

            ActionAssert.Throws <ArgumentNullException>(() => mapper.Type(null));
            ActionAssert.Throws <ArgumentOutOfRangeException>(() => mapper.Type(typeof(object)));
        }
Beispiel #3
0
        public void SetCollectionTypeByType()
        {
            var hbm    = new HbmSet();
            var mapper = new SetMapper(typeof(Animal), typeof(Animal), hbm);

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