コード例 #1
0
ファイル: ProducerFactory.cs プロジェクト: DEFRA/prsd-iws
        public static Producer Create(Guid id, ProducerBusiness business = null, Address address = null, Contact contact = null)
        {
            var producer = ObjectInstantiator <Producer> .CreateNew();

            EntityHelper.SetEntityId(producer, id);

            if (business == null)
            {
                business = ObjectFactory.CreateEmptyProducerBusiness();
            }

            if (address == null)
            {
                address = ObjectFactory.CreateDefaultAddress();
            }

            if (contact == null)
            {
                contact = ObjectFactory.CreateEmptyContact();
            }

            ObjectInstantiator <Producer> .SetProperty(x => x.Business, business, producer);

            ObjectInstantiator <Producer> .SetProperty(x => x.Address, address, producer);

            ObjectInstantiator <Producer> .SetProperty(x => x.Contact, contact, producer);

            return(producer);
        }
コード例 #2
0
ファイル: ExporterFactory.cs プロジェクト: DEFRA/prsd-iws
        public static Exporter Create(Guid id, Business business = null, Address address = null, string name = "AnyName")
        {
            var exporter = ObjectInstantiator <Exporter> .CreateNew();

            EntityHelper.SetEntityId(exporter, id);

            if (business == null)
            {
                business = ComplexTypeFactory.Create <Business>();
                ObjectInstantiator <Business> .SetProperty(x => x.Name, name, business);
            }

            if (address == null)
            {
                address = ComplexTypeFactory.Create <Address>();
            }

            ObjectInstantiator <Exporter> .SetProperty(x => x.Business, business, exporter);

            ObjectInstantiator <Exporter> .SetProperty(x => x.Address, address, exporter);

            ObjectInstantiator <Exporter> .SetProperty(x => x.Contact, ComplexTypeFactory.Create <Contact>(), exporter);

            return(exporter);
        }
コード例 #3
0
        public static CompetentAuthority Create(Guid id, Country country)
        {
            var competentAuthority = ObjectInstantiator <CompetentAuthority> .CreateNew();

            ObjectInstantiator <CompetentAuthority> .SetProperty(x => x.Country, country, competentAuthority);

            ObjectInstantiator <CompetentAuthority> .SetProperty(x => x.Id, id, competentAuthority);

            return(competentAuthority);
        }
コード例 #4
0
        public static EntryOrExitPoint Create(Guid id, Country country)
        {
            var point = ObjectInstantiator <EntryOrExitPoint> .CreateNew();

            ObjectInstantiator <EntryOrExitPoint> .SetProperty(x => x.Id, id, point);

            ObjectInstantiator <EntryOrExitPoint> .SetProperty(x => x.Country, country, point);

            return(point);
        }
コード例 #5
0
        public static FinancialGuarantee Create(Guid id, FinancialGuaranteeStatus status)
        {
            var financialGuarantee = ObjectInstantiator <FinancialGuarantee> .CreateNew();

            ObjectInstantiator <FinancialGuarantee> .SetProperty(fg => fg.Id, id, financialGuarantee);

            ObjectInstantiator <FinancialGuarantee> .SetProperty(fg => fg.Status, status, financialGuarantee);

            return(financialGuarantee);
        }
コード例 #6
0
ファイル: CountryFactory.cs プロジェクト: DEFRA/prsd-iws
        public static Country Create(Guid id, string name = "test", bool isEuMember = true)
        {
            var country = ObjectInstantiator <Country> .CreateNew();

            ObjectInstantiator <Country> .SetProperty(x => x.Id, id, country);

            ObjectInstantiator <Country> .SetProperty(x => x.Name, name, country);

            ObjectInstantiator <Country> .SetProperty(x => x.IsEuropeanUnionMember, isEuMember, country);

            return(country);
        }
コード例 #7
0
        public static InternalUser Create(Guid id, User user)
        {
            var internalUser = ObjectInstantiator <InternalUser> .CreateNew();

            ObjectInstantiator <InternalUser> .SetProperty(x => x.Id, id, internalUser);

            ObjectInstantiator <InternalUser> .SetProperty(x => x.User, user, internalUser);

            ObjectInstantiator <InternalUser> .SetProperty(x => x.UserId, user.Id, internalUser);

            ObjectInstantiator <InternalUser> .SetProperty(x => x.CompetentAuthority, UKCompetentAuthority.England, internalUser);

            return(internalUser);
        }
コード例 #8
0
ファイル: UserFactory.cs プロジェクト: DEFRA/prsd-iws
        public static User Create(Guid id, string firstName, string lastName, string phoneNumber, string email)
        {
            var user = ObjectInstantiator <User> .CreateNew();

            ObjectInstantiator <User> .SetProperty(u => u.Id, id.ToString(), user);

            ObjectInstantiator <User> .SetProperty(u => u.FirstName, firstName, user);

            ObjectInstantiator <User> .SetProperty(u => u.Surname, lastName, user);

            ObjectInstantiator <User> .SetProperty(u => u.PhoneNumber, phoneNumber, user);

            ObjectInstantiator <User> .SetProperty(u => u.Email, email, user);

            ObjectInstantiator <User> .SetProperty(u => u.UserName, email, user);

            return(user);
        }
コード例 #9
0
        public static Importer Create(Guid notiificationId, Guid id, Business business = null, Address address = null, string name = "AnyName")
        {
            if (business == null)
            {
                business = ComplexTypeFactory.Create <Business>();
                ObjectInstantiator <Business> .SetProperty(x => x.Name, name, business);
            }

            if (address == null)
            {
                address = ComplexTypeFactory.Create <Address>();
            }

            var importer = new Importer(notiificationId, address, business, ComplexTypeFactory.Create <Contact>());

            EntityHelper.SetEntityId(importer, id);

            return(importer);
        }