Exemplo n.º 1
0
        public static EmploymentHistory CreateNew(int depth = 0)
        {
            rt.srz.model.srz.EmploymentHistory entity = new rt.srz.model.srz.EmploymentHistory();

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

            entity.Employment = true;

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

            using (rt.srz.business.manager.IInsuredPersonManager insuredPersonManager = ObjectFactory.GetInstance <IInsuredPersonManager>())
            {
                entity.InsuredPerson = null;
            }

            using (rt.srz.business.manager.IPeriodManager periodManager = ObjectFactory.GetInstance <IPeriodManager>())
            {
                entity.Period = null;
            }

            using (rt.srz.business.manager.IQueryResponseManager queryResponseManager = ObjectFactory.GetInstance <IQueryResponseManager>())
            {
                entity.QueryResponse = null;
            }

            return(entity);
        }
Exemplo n.º 2
0
        public void Create()
        {
            try
            {
                rt.srz.model.srz.EmploymentHistory entity = CreateNew();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Exemplo n.º 3
0
        public void Read()
        {
            try
            {
                rt.srz.model.srz.EmploymentHistory entityA = CreateNew();
                manager.Save(entityA);

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

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Exemplo n.º 4
0
        public void Delete()
        {
            try
            {
                rt.srz.model.srz.EmploymentHistory entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.EmploymentHistory entity = GetFirstEmploymentHistory();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Exemplo n.º 5
0
        public void Update()
        {
            try
            {
                rt.srz.model.srz.EmploymentHistory entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.EmploymentHistory entityA = GetFirstEmploymentHistory();

                entityA.Employment = true;

                manager.Update(entityA);

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

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