コード例 #1
0
 public void saveItemStatus()
 {
     if (_dataMapper != null)
     {
         _dataMapper.insertElement(new ITEM_STATUS()
         {
             ITEM_STATUS_NAME = this._itemStatusName, IS_ACTIVE = true
         }, this.ActualUser);
     }
 }
コード例 #2
0
        public void insertElementTest()
        {
            ITEM_STATUS item = new ITEM_STATUS()
            {
                ITEM_STATUS_NAME = "borrado insert "
            };

            ItemStatusDataMapper target = new ItemStatusDataMapper(); // TODO: Inicializar en un valor adecuado
            object element = (object)item;                            // TODO: Inicializar en un valor adecuado

            target.insertElement(element);

            var entity = new TAE2Entities();

            ITEM_STATUS EEst = (ITEM_STATUS)element;

            var query = (from cust in entity.ITEM_STATUS
                         where cust.ITEM_STATUS_NAME == EEst.ITEM_STATUS_NAME
                         select cust).ToList();

            object actual = (object)query;

            Assert.AreEqual(item.ITEM_STATUS_NAME, ((List <ITEM_STATUS>)actual)[0].ITEM_STATUS_NAME);
        }