public void CanSetUnsavedValue() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.UnsavedValue(-1); hbmId.unsavedvalue.Should().Be("-1"); }
public void CanSetLength() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Length(10); hbmId.length.Should().Be("10"); }
public void UnsavedValueUnsetWhenNotSet() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); hbmId.unsavedvalue.Should().Be(null); }
public void CanSetUnsavedValue(object unsavedValue, string expectedUnsavedValue) { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.UnsavedValue(unsavedValue); hbmId.unsavedvalue.Should().Be(expectedUnsavedValue); }
public void CanSetColumnName() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Column("MyName"); hbmId.Columns.Single().name.Should().Be("MyName"); }
public void WhenHasMemberCanSetAccessor() { var member = typeof(Entity).GetProperty("Id", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); var hbmId = new HbmId(); var mapper = new IdMapper(member, hbmId); mapper.Access(Accessor.NoSetter); hbmId.access.Should().Be("nosetter.camelcase"); }
public void CanSetScale() { //NH-2824 var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Column(x => x.Scale(10)); Assert.That(hbmId.column[0].scale, Is.EqualTo("10")); }
public void CanSqlType() { //NH-3452 var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Column(x => x.SqlType("CHAR(10)")); Assert.That(hbmId.column[0].sqltype, Is.EqualTo("CHAR(10)")); }
public void CanSetPrecision() { //NH-2824 var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Column(x => x.Precision(10)); Assert.That(hbmId.column[0].precision, Is.EqualTo("10")); }
public void CanSetLength() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Length(10); Assert.That(hbmId.length, Is.EqualTo("10")); }
public void UnsavedValueUnsetWhenNotSet() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); Assert.That(hbmId.unsavedvalue, Is.EqualTo(null)); }
public void CanSetUnsavedValue(object unsavedValue, string expectedUnsavedValue) { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.UnsavedValue(unsavedValue); Assert.That(hbmId.unsavedvalue, Is.EqualTo(expectedUnsavedValue)); }
public void CanSetColumnName() { var hbmId = new HbmId(); var mapper = new IdMapper(null, hbmId); mapper.Column("MyName"); Assert.That(hbmId.Columns.Single().name, Is.EqualTo("MyName")); }