コード例 #1
0
		public void Get_and_set_unique_key() {
			var m = new AllPropertiesMappingManager();
			m.SetUniqueKey(typeof(Entity).GetProperty("Id"));
			var pk = m.GetUniqueKey(typeof (Entity));
			Assert.IsNotNull(pk);
			Assert.IsNotNull(pk.Property);
			Assert.IsNotNull(pk.FieldName);
			Assert.AreEqual("Id", pk.Property.Name);
			Assert.AreEqual("Id", pk.FieldName);
		}
コード例 #2
0
 public void NoUniqueKey_ShouldThrow()
 {
     var m = new AllPropertiesMappingManager();
     var pk = m.GetUniqueKey(typeof(Entity));
 }
コード例 #3
0
 public void NoUniqueKey_IsNull()
 {
     var m = new AllPropertiesMappingManager();
     var pk = m.GetUniqueKey(typeof(Entity));
     Assert.IsNull(pk);
 }