コード例 #1
0
        public static Workstation CreateNew(int depth = 0)
        {
            rt.srz.model.srz.Workstation entity = new rt.srz.model.srz.Workstation();

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

            entity.Name                     = "T";
            entity.UecReaderName            = "Test Test ";
            entity.UecCerticateType         = default(Byte);
            entity.SmardCardReaderName      = "Test Test ";
            entity.SmardCardTokenReaderName = "Test Test ";

            using (rt.srz.business.manager.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                var          all       = organisationManager.GetAll(1);
                Organisation entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = OrganisationTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.PointDistributionPolicy = entityRef;
            }

            return(entity);
        }
コード例 #2
0
        protected rt.srz.model.srz.Organisation GetFirstOrganisation()
        {
            IList <rt.srz.model.srz.Organisation> entityList = manager.GetAll(1);

            if (entityList.Count == 0)
            {
                Assert.Fail("All tables must have at least one row for unit tests to succeed.");
            }
            return(entityList[0]);
        }
コード例 #3
0
        public static RangeNumber CreateNew(int depth = 0)
        {
            rt.srz.model.srz.RangeNumber entity = new rt.srz.model.srz.RangeNumber();

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

            entity.RangelFrom = 1;
            entity.RangelTo   = 19;
            entity.ChangeDate = System.DateTime.Now;

            using (rt.srz.business.manager.IRangeNumberManager rangeNumberMemberManager = ObjectFactory.GetInstance <IRangeNumberManager>())
            {
                entity.Parent = null;
            }

            using (rt.srz.business.manager.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                var          all       = organisationManager.GetAll(1);
                Organisation entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = OrganisationTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.Smo = entityRef;
            }

            using (rt.srz.business.manager.ITemplateManager templateManager = ObjectFactory.GetInstance <ITemplateManager>())
            {
                entity.Template = null;
            }

            return(entity);
        }
コード例 #4
0
        public static In1 CreateNew(int depth = 0)
        {
            rt.srz.model.srz.In1 entity = new rt.srz.model.srz.In1();

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

            entity.Number      = default(Int16);
            entity.PolisSeria  = "Te";
            entity.PolisNumber = "Test Test Te";
            entity.DateFrom    = System.DateTime.Now;
            entity.DateTo      = System.DateTime.Now;
            entity.DateStop    = System.DateTime.Now;

            using (rt.srz.business.manager.IQueryResponseManager queryResponseManager = ObjectFactory.GetInstance <IQueryResponseManager>())
            {
                var           all       = queryResponseManager.GetAll(1);
                QueryResponse entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = QueryResponseTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.QueryResponse = entityRef;
            }

            using (rt.srz.business.manager.IConceptManager conceptManager = ObjectFactory.GetInstance <IConceptManager>())
            {
                var     all       = conceptManager.GetAll(1);
                Concept entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = ConceptTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.PolisType = entityRef;
            }

            using (rt.srz.business.manager.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                var          all       = organisationManager.GetAll(1);
                Organisation entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = OrganisationTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.Smo = entityRef;
            }

            return(entity);
        }
コード例 #5
0
        public static MedicalInsurance CreateNew(int depth = 0)
        {
            rt.srz.model.srz.MedicalInsurance entity = new rt.srz.model.srz.MedicalInsurance();

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

            entity.PolisSeria    = "Test Test Test Te";
            entity.PolisNumber   = "Test Test Test Test";
            entity.DateFrom      = System.DateTime.Now;
            entity.DateTo        = System.DateTime.Now;
            entity.IsActive      = true;
            entity.DateStop      = System.DateTime.Now;
            entity.Enp           = "T";
            entity.StateDateFrom = System.DateTime.Now;
            entity.StateDateTo   = System.DateTime.Now;

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

            using (rt.srz.business.manager.IConceptManager conceptManager = ObjectFactory.GetInstance <IConceptManager>())
            {
                var     all       = conceptManager.GetAll(1);
                Concept entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = ConceptTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.PolisType = entityRef;
            }

            using (rt.srz.business.manager.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                var          all       = organisationManager.GetAll(1);
                Organisation entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = OrganisationTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.Smo = entityRef;
            }

            using (rt.srz.business.manager.IStatementManager statementManager = ObjectFactory.GetInstance <IStatementManager>())
            {
                var       all       = statementManager.GetAll(1);
                Statement entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = StatementTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.Statement = entityRef;
            }

            return(entity);
        }