public void CanSetUnsavedValue()
 {
     var hbmId = new HbmId();
     var mapper = new IdMapper(null, hbmId);
     mapper.UnsavedValue(-1);
     hbmId.unsavedvalue.Should().Be("-1");
 }
Exemplo n.º 2
0
		public void CanSetLength()
		{
			var hbmId = new HbmId();
			var mapper = new IdMapper(null, hbmId);
			mapper.Length(10);
			hbmId.length.Should().Be("10");
		}
Exemplo n.º 3
0
		public void UnsavedValueUnsetWhenNotSet()
		{
			var hbmId = new HbmId();
			var mapper = new IdMapper(null, hbmId);
			hbmId.unsavedvalue.Should().Be(null);
		}
Exemplo n.º 4
0
		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);
		}
Exemplo n.º 5
0
		public void CanSetColumnName()
		{
			var hbmId = new HbmId();
			var mapper = new IdMapper(null, hbmId);
			mapper.Column("MyName");
			hbmId.Columns.Single().name.Should().Be("MyName");
		}
Exemplo n.º 6
0
		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");
		}
Exemplo n.º 7
0
		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"));
		}
Exemplo n.º 8
0
		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)"));
		}
Exemplo n.º 9
0
		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"));
		}
Exemplo n.º 10
0
		public void CanSetLength()
		{
			var hbmId = new HbmId();
			var mapper = new IdMapper(null, hbmId);
			mapper.Length(10);
			Assert.That(hbmId.length, Is.EqualTo("10"));
		}
Exemplo n.º 11
0
		public void UnsavedValueUnsetWhenNotSet()
		{
			var hbmId = new HbmId();
			var mapper = new IdMapper(null, hbmId);
			Assert.That(hbmId.unsavedvalue, Is.EqualTo(null));
		}
Exemplo n.º 12
0
		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));
		}
Exemplo n.º 13
0
		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"));
		}