Ejemplo n.º 1
0
        public void TechnicalRequestAcceptenceStatus()
        {
            int count = uow.TechnicalRequestAcceptenceStatuses.GetAll().AsQueryable<TechnicalRequestAcceptenceStatus>().Count<TechnicalRequestAcceptenceStatus>();

            #region Add

            TechnicalRequestAcceptenceStatus newEntity = new TechnicalRequestAcceptenceStatus()
            {
                AcceptanceStatusName = "AcceptanceStatusName",
                NextStatusName = "NextStatusName"
            };
            uow.TechnicalRequestAcceptenceStatuses.Add<TechnicalRequestAcceptenceStatus, int>(newEntity);
            uow.TechnicalRequestAcceptenceStatuses.Commit();
            var result = uow.TechnicalRequestAcceptenceStatuses.GetAll().AsQueryable<TechnicalRequestAcceptenceStatus>();
            Assert.AreEqual(count + 1, result.Count<TechnicalRequestAcceptenceStatus>(), "Adding Error");

            #endregion

            #region Update

            TechnicalRequestAcceptenceStatus entity = uow.TechnicalRequestAcceptenceStatuses.GetById(newEntity.ID);
            entity.AcceptanceStatusName = "AcceptanceStatusName2";
            entity.NextStatusName = "NextStatusName2";
            uow.TechnicalRequestAcceptenceStatuses.Update(entity);
            uow.TechnicalRequestAcceptenceStatuses.Commit();
            TechnicalRequestAcceptenceStatus entity2 = uow.TechnicalRequestAcceptenceStatuses.GetById(newEntity.ID);
            Assert.AreEqual("AcceptanceStatusName2", entity2.AcceptanceStatusName, "Updating Error");
            Assert.AreEqual("NextStatusName2", entity2.NextStatusName, "Updating Error");

            #endregion

            #region Delete

            TechnicalRequestAcceptenceStatus entityDeleted = uow.TechnicalRequestAcceptenceStatuses.GetById(newEntity.ID);
            uow.TechnicalRequestAcceptenceStatuses.Delete(entity2);
            uow.TechnicalRequestAcceptenceStatuses.Commit();
            Assert.AreEqual(count, uow.TechnicalRequestAcceptenceStatuses.GetAll().AsQueryable<TechnicalRequestAcceptenceStatus>().Count<TechnicalRequestAcceptenceStatus>(), "Deleting Error");

            #endregion
        }
Ejemplo n.º 2
0
 static int TechnicalRequestAcceptenceStatus()
 {
     TechnicalRequestAcceptenceStatus e = new TechnicalRequestAcceptenceStatus()
     {
         AcceptanceStatusName = "AcceptanceStatusName",
         NextStatusName = "NextStatusName"
     };
     technicalLicensesUow.TechnicalRequestAcceptenceStatuses.Add<TechnicalRequestAcceptenceStatus, int>(e);
     technicalLicensesUow.TechnicalRequestAcceptenceStatuses.Commit();
     return e.ID;
 }