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

            // You may need to maually enter this key if there is a constraint violation.
            entity.Id = System.Guid.NewGuid();

            entity.Number          = default(Int16);
            entity.PolisNumber     = "Test ";
            entity.MainPolisNumber = "Test T";
            entity.Snils           = "Test";
            entity.IsActive        = true;
            entity.Employment      = true;

            using (rt.srz.business.manager.IaddressManager addressManager = ObjectFactory.GetInstance <IaddressManager>())
            {
                entity.Address = null;
            }

            using (rt.srz.business.manager.IConceptManager concept1Manager = ObjectFactory.GetInstance <IConceptManager>())
            {
                entity.Feature = null;
            }

            using (rt.srz.business.manager.IDeadInfoManager deadInfoManager = ObjectFactory.GetInstance <IDeadInfoManager>())
            {
                entity.DeadInfo = null;
            }

            using (rt.srz.business.manager.IDocumentManager documentManager = ObjectFactory.GetInstance <IDocumentManager>())
            {
                entity.DocumentUdl = null;
            }

            using (rt.srz.business.manager.IInsuredPersonDatumManager insuredPersonDatumManager = ObjectFactory.GetInstance <IInsuredPersonDatumManager>())
            {
                entity.InsuredPersonData = null;
            }

            using (rt.srz.business.manager.IMessageManager messageManager = ObjectFactory.GetInstance <IMessageManager>())
            {
                entity.Message = null;
            }

            using (rt.srz.business.manager.IConceptManager concept2Manager = ObjectFactory.GetInstance <IConceptManager>())
            {
                entity.TrustLevel = null;
            }

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

                object result = manager.Save(entity);

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

                rt.srz.model.srz.QueryResponse entityB = manager.GetById(entityA.Id);

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

                rt.srz.model.srz.QueryResponse entity = GetFirstQueryResponse();

                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.srz.model.srz.QueryResponse entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.QueryResponse entityA = GetFirstQueryResponse();

                entityA.Number = default(Int16);

                manager.Update(entityA);

                rt.srz.model.srz.QueryResponse entityB = manager.GetById(entityA.Id);

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