コード例 #1
0
        public void Create()
        {
            try
            {
                rt.srz.model.srz.InsuredPersonDatum entity = CreateNew();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
コード例 #2
0
        public void Read()
        {
            try
            {
                rt.srz.model.srz.InsuredPersonDatum entityA = CreateNew();
                manager.Save(entityA);

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

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
コード例 #3
0
        public static InsuredPersonDatum CreateNew(int depth = 0)
        {
            rt.srz.model.srz.InsuredPersonDatum entity = new rt.srz.model.srz.InsuredPersonDatum();

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

            entity.FirstName        = "Test Test Test Test Tes";
            entity.LastName         = "Te";
            entity.MiddleName       = "Test Tes";
            entity.Birthday         = System.DateTime.Now;
            entity.Birthday2        = "Tes";
            entity.BirthdayType     = 40;
            entity.IsIncorrectDate  = true;
            entity.IsNotGuru        = true;
            entity.Snils            = "Te";
            entity.Birthplace       = "Test Test ";
            entity.IsNotCitizenship = true;
            entity.IsRefugee        = true;
            entity.IsBadSnils       = true;
            entity.NhFirstName      = 25;
            entity.NhLastName       = 91;
            entity.NhMiddleName     = 94;

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

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

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

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

            return(entity);
        }
コード例 #4
0
        public void Delete()
        {
            try
            {
                rt.srz.model.srz.InsuredPersonDatum entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.InsuredPersonDatum entity = GetFirstInsuredPersonDatum();

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

                rt.srz.model.srz.InsuredPersonDatum entityA = GetFirstInsuredPersonDatum();

                entityA.FirstName = "Test Test Test T";

                manager.Update(entityA);

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

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