Пример #1
0
        public static Prz CreateNew(int depth = 0)
        {
            rt.atl.model.atl.Prz entity = new rt.atl.model.atl.Prz();


            entity.Dedit    = System.DateTime.Now;
            entity.Caption  = "Test Test Test Test Test Test Test Test Test Te";
            entity.Code     = "123";
            entity.Fullname = "Test Test ";
            entity.Ogrn     = "Test Test ";
            entity.Bossname = "Test Test Tes";
            entity.Buhname  = "Test Test Test Test Test ";
            entity.Email    = "Test Test Test Test Test Test Test Tes";
            entity.Tel1     = "Test Test ";
            entity.Tel2     = "Test Test ";
            entity.Addr     = "Test Test ";
            entity.Okato    = "Test ";
            entity.Extcode  = "Test ";
            entity.Main     = true;

            using (rt.atl.business.manager.ISmoManager smoManager = ObjectFactory.GetInstance <ISmoManager>())
            {
                entity.SMO = null;
            }

            return(entity);
        }
Пример #2
0
        public void Create()
        {
            try
            {
                rt.atl.model.atl.Prz entity = CreateNew();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Пример #3
0
        public void Read()
        {
            try
            {
                rt.atl.model.atl.Prz entityA = CreateNew();
                manager.Save(entityA);

                rt.atl.model.atl.Prz entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Пример #4
0
        public void Delete()
        {
            try
            {
                rt.atl.model.atl.Prz entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.atl.model.atl.Prz entity = GetFirstPrz();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Пример #5
0
        public void Update()
        {
            try
            {
                rt.atl.model.atl.Prz entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.atl.model.atl.Prz entityA = GetFirstPrz();

                entityA.Dedit = System.DateTime.Now;

                manager.Update(entityA);

                rt.atl.model.atl.Prz entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA.Dedit, entityB.Dedit);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }