Exemple #1
0
        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>());
        }
Exemple #2
0
        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>();
        }
Exemple #3
0
        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"));
        }
Exemple #4
0
        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"));
        }
Exemple #5
0
        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 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 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 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>());
		}