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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }