public void WhenSetInvalidTypeThenThrow()
        {
            var hbmDiscriminator = new HbmDiscriminator();
            var mapper           = new DiscriminatorMapper(hbmDiscriminator);

            ActionAssert.Throws <ArgumentOutOfRangeException>(() => mapper.Type(typeof(object)));
            ActionAssert.Throws <ArgumentNullException>(() => mapper.Type((Type)null));
        }
Exemple #2
0
        public void WhenSetInvalidTypeThenThrow()
        {
            var hbmDiscriminator = new HbmDiscriminator();
            var mapper           = new DiscriminatorMapper(hbmDiscriminator);

            Executing.This(() => mapper.Type(typeof(object))).Should().Throw <ArgumentOutOfRangeException>();
            Executing.This(() => mapper.Type((Type)null)).Should().Throw <ArgumentNullException>();
        }
Exemple #3
0
        public void WhenSetTypeByGenericMethodThenSetTypeName()
        {
            var hbmDiscriminator = new HbmDiscriminator();
            var mapper           = new DiscriminatorMapper(hbmDiscriminator);

            mapper.Type <EnumStringType <MyEnum> >();
            hbmDiscriminator.type.Should().Contain(typeof(EnumStringType <MyEnum>).FullName);
        }
Exemple #4
0
        public void WhenSetTypeByIDiscriminatorThenSetTypeName()
        {
            var hbmDiscriminator = new HbmDiscriminator();
            var mapper           = new DiscriminatorMapper(hbmDiscriminator);

            mapper.Type(NHibernateUtil.String);
            hbmDiscriminator.type.Should().Contain("String");
        }
 public void WhenSetTypeByITypeThenSetTypeName()
 {
     var hbmDiscriminator = new HbmDiscriminator();
     var mapper = new DiscriminatorMapper(hbmDiscriminator);
     mapper.Type(NHibernateUtil.String);
     hbmDiscriminator.type.Should().Be.EqualTo("String");
 }
 public void WhenSetTypeByGenericMethodThenSetTypeName()
 {
     var hbmDiscriminator = new HbmDiscriminator();
     var mapper = new DiscriminatorMapper(hbmDiscriminator);
     mapper.Type<EnumStringType<MyEnum>>();
     hbmDiscriminator.type.Should().Contain(typeof(EnumStringType<MyEnum>).FullName);
 }
 public void WhenSetInvalidTypeThenThrow()
 {
     var hbmDiscriminator = new HbmDiscriminator();
     var mapper = new DiscriminatorMapper(hbmDiscriminator);
     ActionAssert.Throws<ArgumentOutOfRangeException>(() => mapper.Type(typeof(object)));
     ActionAssert.Throws<ArgumentNullException>(() => mapper.Type((Type)null));
 }