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)); }
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>(); }
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 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)); }