Exemple #1
0
        public void WhenSetTypeByICompositeUserTypeThenSetTypeName()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            Assert.That(() => mapper.Type <MyCompoType>(), Throws.Nothing);
            Assert.That(mapping.Type.name, Does.Contain(nameof(MyCompoType)));
        }
Exemple #2
0
        public void WhenSetTypeByITypeTypeThenSetType()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Type <EnumStringType <MyEnum> >();

            mapping.Type.name.Should().Contain(typeof(EnumStringType <MyEnum>).FullName);
        }
Exemple #3
0
        public void WhenSetTypeByIUserTypeThenSetTypeName()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Type <MyType>();

            mapping.Type.name.Should().Contain("MyType");
        }
Exemple #4
0
        public void WhenSetTypeByITypeThenSetTypeName()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Type(NHibernateUtil.String);

            mapping.Type.name.Should().Be.EqualTo("String");
        }
Exemple #5
0
        public void WhenSetMultiColumnsValuesThenAddColumns()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Type <MyType>();
            mapper.Columns(cm =>
            {
                cm.Name("column1");
                cm.Length(50);
            }, cm =>
            {
                cm.Name("column2");
                cm.SqlType("VARCHAR(10)");
            });
            mapping.Columns.Should().Have.Count.EqualTo(2);
        }
        public void WhenSetTypeByIUserTypeThenSetTypeName()
        {
            var mapping = new HbmMapKey();
            var mapper = new MapKeyMapper(mapping);
            mapper.Type<MyType>();

            mapping.Type.name.Should().Contain("MyType");
        }
        public void WhenSetTypeByITypeTypeThenSetType()
        {
            var mapping = new HbmMapKey();
            var mapper = new MapKeyMapper(mapping);
            mapper.Type<EnumStringType<MyEnum>>();

            mapping.Type.name.Should().Contain(typeof(EnumStringType<MyEnum>).FullName);
        }
        public void WhenSetTypeByITypeThenSetTypeName()
        {
            var mapping = new HbmMapKey();
            var mapper = new MapKeyMapper(mapping);
            mapper.Type(NHibernateUtil.String);

            mapping.Type.name.Should().Be.EqualTo("String");
        }
 public void WhenSetMultiColumnsValuesThenAddColumns()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Type<MyType>();
     mapper.Columns(cm =>
     {
         cm.Name("column1");
         cm.Length(50);
     }, cm =>
     {
         cm.Name("column2");
         cm.SqlType("VARCHAR(10)");
     });
     mapping.Columns.Should().Have.Count.EqualTo(2);
 }