コード例 #1
0
        public void IsAutoIncrement_Entity_Has_Not()
        {
            //Arrange
            Entity_Not_AutoInCreament_KeyAttribute_intType entity = new Entity_Not_AutoInCreament_KeyAttribute_intType();
            //Action
            var actual = ReflectionHelper.ExistsAutoIncrementKey(entity.GetType());
            // Assert
            var expected = false;

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void IsAutoIncrementColumn_KeyAttribute_intType_Not()
        {
            //Arrange
            Entity_Not_AutoInCreament_KeyAttribute_intType entity = new Entity_Not_AutoInCreament_KeyAttribute_intType();
            var pi = entity.GetType().GetProperty("SysNo");
            //Action
            var actual = ReflectionHelper.IsKeyAndAutoIncrement(pi);
            // Assert
            var expected = false;

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void SetPrimaryKey_Insert_Entity_then_Not_Get_Id_Value()
        {
            //Arrange
            Entity_Not_AutoInCreament_KeyAttribute_intType entity = new Entity_Not_AutoInCreament_KeyAttribute_intType();

            //Action
            ReflectionHelper.SetPrimaryKey(entity, 100);
            var actual = entity.SysNo;
            // Assert
            var expected = 0;

            Assert.AreEqual(expected, actual);
        }