public void CatSetColumnByName()
 {
     var hbm = new HbmMapKey();
     var mapper = new MapKeyMapper(hbm);
     mapper.Column("pizza");
     hbm.column.Should().Be("pizza");
 }
Exemple #2
0
        public void CatSetColumnByName()
        {
            var hbm    = new HbmMapKey();
            var mapper = new MapKeyMapper(hbm);

            mapper.Column("pizza");
            hbm.column.Should().Be("pizza");
        }
 public void SettingColumnOverridesFormula()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Formula("formula");
     mapper.Column(cm => cm.Unique(true));
     mapping.formula.Should().Be.Null();
 }
Exemple #4
0
        public void SettingColumnOverridesFormula()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Formula("formula");
            mapper.Column(cm => cm.Unique(true));
            mapping.formula.Should().Be.Null();
        }
 public void SettingColumnPlainValuesOverridesFormula()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Formula("formula");
     mapper.Column("colName");
     mapping.formula.Should().Be.Null();
     mapping.column.Should().Be("colName");
 }
Exemple #6
0
        public void WhenSetDifferentColumnNameThenSetTheName()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column(cm => cm.Name("pepe"));

            mapping.Columns.Should().Have.Count.EqualTo(1);
            mapping.Columns.Single().name.Should().Be("pepe");
        }
Exemple #7
0
        public void SettingColumnPlainValuesOverridesFormula()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Formula("formula");
            mapper.Column("colName");
            mapping.formula.Should().Be.Null();
            mapping.column.Should().Be("colName");
        }
Exemple #8
0
        public void WhenSetFormulaWithNullThenDoNothing()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column("MyColumn");
            mapper.Formula(null);
            mapping.formula.Should().Be.Null();
            mapping.column.Should().Not.Be.Null();
        }
 public void SettingFormulaOverridesColumnNodes()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Column(cm => cm.SqlType("VARCHAR(80)"));
     mapper.Formula("formula");
     mapping.formula.Should().Be("formula");
     mapping.column.Should().Be(null);
     mapping.Items.Should().Be.Null();
 }
        public void WhenSetBasicColumnValuesThroughShortCutThenMergeColumn()
        {
            var mapping = new HbmMapKey();
            var mapper = new MapKeyMapper(mapping);
            mapper.Column("pizza");
            mapper.Length(50);

            mapping.Items.Should().Be.Null();
            mapping.column.Should().Be("pizza");
            mapping.length.Should().Be("50");
        }
Exemple #11
0
        public void WhenSetFormulaThenResetColumn()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column("MyColumn");
            mapper.Formula("SomeFormula");
            mapping.formula.Should().Be("SomeFormula");
            mapping.column.Should().Be.Null();
            mapping.Items.Should().Be.Null();
        }
Exemple #12
0
        public void SettingFormulaOverridesColumnNodes()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column(cm => cm.SqlType("VARCHAR(80)"));
            mapper.Formula("formula");
            mapping.formula.Should().Be("formula");
            mapping.column.Should().Be(null);
            mapping.Items.Should().Be.Null();
        }
 public void WhenSetBasicColumnValuesThenSetPlainValues()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Column(cm =>
     {
         cm.Length(50);
     });
     mapping.Items.Should().Be.Null();
     mapping.length.Should().Be("50");
 }
Exemple #14
0
        public void WhenSetBasicColumnValuesThenSetPlainValues()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column(cm =>
            {
                cm.Length(50);
            });
            mapping.Items.Should().Be.Null();
            mapping.length.Should().Be("50");
        }
Exemple #15
0
        public void WhenSetBasicColumnValuesThroughShortCutThenMergeColumn()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column("pizza");
            mapper.Length(50);

            mapping.Items.Should().Be.Null();
            mapping.column.Should().Be("pizza");
            mapping.length.Should().Be("50");
        }
Exemple #16
0
        public void WhenSetColumnValuesThenAddColumnTag()
        {
            var mapping = new HbmMapKey();
            var mapper  = new MapKeyMapper(mapping);

            mapper.Column(cm =>
            {
                cm.SqlType("VARCHAR(50)");
                cm.NotNullable(true);
            });
            mapping.Items.Should().Not.Be.Null();
            mapping.Columns.Should().Have.Count.EqualTo(1);
        }
 public void WhenSetFormulaThenResetColumn()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Column("MyColumn");
     mapper.Formula("SomeFormula");
     mapping.formula.Should().Be("SomeFormula");
     mapping.column.Should().Be.Null();
     mapping.Items.Should().Be.Null();
 }
 public void WhenSetColumnValuesThenAddColumnTag()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Column(cm =>
     {
         cm.SqlType("VARCHAR(50)");
         cm.NotNullable(true);
     });
     mapping.Items.Should().Not.Be.Null();
     mapping.Columns.Should().Have.Count.EqualTo(1);
 }
 public void WhenSetFormulaWithNullThenDoNothing()
 {
     var mapping = new HbmMapKey();
     var mapper = new MapKeyMapper(mapping);
     mapper.Column("MyColumn");
     mapper.Formula(null);
     mapping.formula.Should().Be.Null();
     mapping.column.Should().Not.Be.Null();
 }
        public void WhenSetDifferentColumnNameThenSetTheName()
        {
            var mapping = new HbmMapKey();
            var mapper = new MapKeyMapper(mapping);
            mapper.Column(cm => cm.Name("pepe"));

            mapping.Columns.Should().Have.Count.EqualTo(1);
            mapping.Columns.Single().name.Should().Be("pepe");
        }