public void CanSetFormula() { var mapping = new HbmManyToMany(); var mapper = new ManyToManyMapper(typeof(MyClass), mapping, null); mapper.Formula("SomeFormula"); mapping.formula.Should().Be("SomeFormula"); }
public void SettingColumnOverridesFormula() { var mapping = new HbmManyToMany(); var mapper = new ManyToManyMapper(typeof(MyClass), mapping, null); mapper.Formula("formula"); mapper.Column(cm => cm.Unique(true)); mapping.formula.Should().Be.Null(); }
public void WhenSetFormulaWithNullThenDoNothing() { var mapping = new HbmManyToMany(); var mapper = new ManyToManyMapper(typeof(MyClass), mapping, null); mapper.Column("MyColumn"); mapper.Formula(null); mapping.formula.Should().Be.Null(); mapping.column.Should().Not.Be.Null(); }
public void WhenSetFormulaThenResetColumn() { var mapping = new HbmManyToMany(); var mapper = new ManyToManyMapper(typeof(MyClass), mapping, null); mapper.Column("MyColumn"); mapper.Formula("SomeFormula"); mapping.formula.Should().Be("SomeFormula"); mapping.column.Should().Be.Null(); mapping.Items.Should().Be.Null(); }
public void SettingFormulaOverridesColumnNodes() { var mapping = new HbmManyToMany(); var mapper = new ManyToManyMapper(typeof(MyClass), mapping, null); 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(); }