public void SetCollectionTypeByWrongTypeShouldThrow() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); Assert.That(() => mapper.Type(null), Throws.TypeOf <ArgumentNullException>()); Assert.That(() => mapper.Type(typeof(object)), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void SetCollectionTypeByWrongTypeShouldThrow() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(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 HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); mapper.Type(typeof(FakeUserCollectionType)); Assert.That(hbm.CollectionType, Is.StringContaining("FakeUserCollectionType")); }
public void SetCollectionTypeByGenericType() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); mapper.Type <FakeUserCollectionType>(); Assert.That(hbm.CollectionType, Does.Contain("FakeUserCollectionType")); }
public void SetCollectionTypeByType() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); mapper.Type(typeof(FakeUserCollectionType)); hbm.CollectionType.Should().Contain("FakeUserCollectionType"); }
public void SetCollectionTypeByWrongTypeShouldThrow() { var hbm = new HbmIdbag(); var mapper = new IdBagMapper(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 HbmIdbag(); var mapper = new IdBagMapper(typeof(Animal), typeof(Animal), hbm); Assert.That(() => mapper.Type(null), Throws.TypeOf<ArgumentNullException>()); Assert.That(() => mapper.Type(typeof(object)), Throws.TypeOf<ArgumentOutOfRangeException>()); }