Esempio n. 1
0
 private VmOpenApiLanguageItem CreateViewModel()
 {
     return(new VmOpenApiLanguageItem()
     {
         Value = REQUIREMENT_MARKDOWN,
         Language = TestDataFactory.LocalizationFi().Code
     });
 }
 private WebPage CreateModel()
 {
     return(new WebPage()
     {
         Id = Guid.NewGuid(),
         Name = TestDataFactory.WEBPAGE_NAME,
         Description = TestDataFactory.TEXT,
         Url = TestDataFactory.URI,
         Localization = TestDataFactory.LocalizationFi()
     });
 }
 private IList <OrganizationAddress> CreateAddresses()
 {
     return(new List <OrganizationAddress>
     {
         new OrganizationAddress
         {
             Address = TestDataFactory.CreateAddress(CacheManager.TypesCache.Get <AddressType>(AddressTypeEnum.Street.ToString())),
             CharacterId = CacheManager.TypesCache.Get <AddressCharacter>(AddressCharacterEnum.Postal.ToString())
         }
     });
 }
 private static IVmOpenApiOrganizationInVersionBase CreateOrganizationVm()
 {
     return(new VmOpenApiOrganizationInVersionBase()
     {
         OrganizationType = OrganizationTypeEnum.Municipality.ToString(),
         Municipality = "620",
         BusinessCode = TestDataFactory.TEXT,
         OrganizationNames = TestDataFactory.CreateLocalizedList(NameTypeEnum.Name.ToString()),
         OrganizationDescriptions = TestDataFactory.CreateLocalizedList("Description").ToList(),
         EmailAddresses = new List <V4VmOpenApiEmail> {
             new V4VmOpenApiEmail {
                 Value = EMAIL_FI, Description = DESCRIPTION_FI, Language = LanguageCode.fi.ToString()
             },
             new V4VmOpenApiEmail {
                 Value = EMAIL_SV, Description = DESCRIPTION_SV, Language = LanguageCode.sv.ToString()
             }
         },
         PhoneNumbers = new List <V4VmOpenApiPhone>
         {
             new V4VmOpenApiPhone {
                 ServiceChargeType = ServiceChargeTypeEnum.Charged.ToString(),
                 Number = PHONE_NUMBER,
                 PrefixNumber = PHONE_PREFIX,
                 Language = LanguageCode.fi.ToString(),
                 AdditionalInformation = DESCRIPTION_FI
             },
             new V4VmOpenApiPhone {
                 ServiceChargeType = ServiceChargeTypeEnum.Charged.ToString(),
                 Number = PHONE_NUMBER,
                 PrefixNumber = PHONE_PREFIX,
                 Language = LanguageCode.sv.ToString(),
                 AdditionalInformation = DESCRIPTION_SV
             }
         },
         Addresses = new List <V7VmOpenApiAddressWithForeignIn>()
         {
             TestDataFactory.CreateAddressVm <V7VmOpenApiAddressWithForeignIn>(AddressTypeEnum.Street),
             TestDataFactory.CreateAddressVm <V7VmOpenApiAddressWithForeignIn>(AddressTypeEnum.PostOfficeBox),
             TestDataFactory.CreateAddressVm <V7VmOpenApiAddressWithForeignIn>(AddressTypeEnum.Foreign)
         },
         WebPages = TestDataFactory.CreateWebPageListVm <VmOpenApiWebPageWithOrderNumber>(),
         PublishingStatus = PublishingStatus.Published.ToString(),
         DisplayNameType = new List <VmOpenApiNameTypeByLanguage>()
         {
             new VmOpenApiNameTypeByLanguage()
             {
                 Language = LanguageCode.fi.ToString(),
                 Type = NameTypeEnum.Name.ToString()
             }
         }
     });
 }
 private Municipality CreateModel()
 {
     return(new Municipality()
     {
         Code = TestDataFactory.TEXT,
         MunicipalityNames = new List <MunicipalityName>()
         {
             new MunicipalityName()
             {
                 Name = TestDataFactory.TEXT,
                 Localization = TestDataFactory.LocalizationFi()
             }
         }
     });
 }
 private Area CreateModel()
 {
     return(new Area()
     {
         Code = TestDataFactory.TEXT,
         AreaNames = new List <AreaName>()
         {
             new AreaName()
             {
                 Name = TestDataFactory.TEXT,
                 Localization = TestDataFactory.LocalizationFi()
             }
         }
     });
 }
 private Language CreateModel()
 {
     return(new Language()
     {
         Code = TestDataFactory.TEXT,
         Names = new List <LanguageName>()
         {
             new LanguageName()
             {
                 Name = TestDataFactory.TEXT,
                 Localization = TestDataFactory.LocalizationFi()
             }
         }
     });
 }
 private PostalCode CreateModel()
 {
     return(new PostalCode()
     {
         Code = TestDataFactory.TEXT,
         PostalCodeNames = new List <PostalCodeName>()
         {
             new PostalCodeName()
             {
                 Name = TestDataFactory.TEXT,
                 Localization = TestDataFactory.LocalizationFi()
             }
         }
     });
 }
Esempio n. 9
0
 private Country CreateModel()
 {
     return(new Country()
     {
         Code = TestDataFactory.TEXT,
         CountryNames = new List <CountryName>()
         {
             new CountryName()
             {
                 Name = TestDataFactory.TEXT,
                 Localization = TestDataFactory.LocalizationFi()
             }
         },
         DialCodes = new List <DialCode>()
         {
             new DialCode()
             {
                 Code = TestDataFactory.TEXT
             }
         }
     });
 }
Esempio n. 10
0
 private StatutoryServiceGeneralDescriptionVersioned CreateGeneralDescription()
 {
     return(new StatutoryServiceGeneralDescriptionVersioned()
     {
         Descriptions = new List <StatutoryServiceDescription>()
         {
             new StatutoryServiceDescription()
             {
                 Description = GENERAL_DESCRIPTION_JSON,
                 Localization = TestDataFactory.LocalizationFi(),
                 TypeId = CacheManager.TypesCache.Get <DescriptionType>(DescriptionTypeEnum.Description.ToString()),
             }
         },
         Names = new List <StatutoryServiceName>()
         {
             new StatutoryServiceName()
             {
                 Name = NAME,
                 Localization = TestDataFactory.LocalizationFi(),
                 Type = new NameType()
                 {
                     Code = NameTypeEnum.Name.ToString()
                 }
             }
         },
         ServiceClasses = new List <StatutoryServiceServiceClass>()
         {
             new StatutoryServiceServiceClass()
             {
                 ServiceClass = TestDataFactory.CreateServiceClass()
             }
         },
         TargetGroups = new List <StatutoryServiceTargetGroup>()
         {
             new StatutoryServiceTargetGroup()
             {
                 TargetGroup = TestDataFactory.CreateTargetGroup()
             }
         },
         OntologyTerms = new List <StatutoryServiceOntologyTerm>()
         {
             new StatutoryServiceOntologyTerm()
             {
                 OntologyTerm = TestDataFactory.CreateOntologyTerm()
             }
         },
         LifeEvents = new List <StatutoryServiceLifeEvent>()
         {
             new StatutoryServiceLifeEvent()
             {
                 LifeEvent = TestDataFactory.CreateLifeEvent()
             }
         },
         Languages = new List <StatutoryServiceLanguage>()
         {
             new StatutoryServiceLanguage()
             {
                 Language = TestDataFactory.LocalizationFi()
             },
             new StatutoryServiceLanguage()
             {
                 Language = TestDataFactory.LocalizationSv()
             }
         }
     });
 }
 private OrganizationVersioned CreateOrganization()
 {
     return(new OrganizationVersioned
     {
         OrganizationNames = new List <OrganizationName>()
         {
             new OrganizationName()
             {
                 Name = "Organization1",
                 Type = new NameType {
                     Code = OrganizationTypeEnum.RegionalOrganization.ToString()
                 },
                 Localization = TestDataFactory.LocalizationFi()
             }
         },
         OrganizationDisplayNameTypes = new List <OrganizationDisplayNameType>()
         {
             new OrganizationDisplayNameType()
             {
                 DisplayNameTypeId = CacheManager.TypesCache.Get <NameType>(NameTypeEnum.Name.ToString()),
                 LocalizationId = fiId
             }
         },
         OrganizationDescriptions = new List <OrganizationDescription>()
         {
             new OrganizationDescription()
             {
                 Description = DESCRIPTION_FI_JSON,
                 Localization = TestDataFactory.LocalizationFi(),
                 Type = new DescriptionType()
                 {
                     Code = DescriptionTypeEnum.Description.ToString()
                 }
             }
         },
         Municipality = new Municipality()
         {
             MunicipalityNames = new List <MunicipalityName>()
             {
                 new MunicipalityName()
                 {
                     Name = MUNICIPALITY
                 }
             }
         },
         TypeId = CacheManager.TypesCache.Get <OrganizationType>(OrganizationTypeEnum.Municipality.ToString()),
         OrganizationAddresses = CreateAddresses(),
         OrganizationPhones = new List <OrganizationPhone>
         {
             new OrganizationPhone
             {
                 Phone = new Phone
                 {
                     TypeId = CacheManager.TypesCache.Get <PhoneNumberType>(PhoneNumberTypeEnum.Phone.ToString()),
                     Number = PHONE_NUMBER,
                     PrefixNumber = new DialCode()
                     {
                         Code = PHONE_PREFIX
                     },
                     ChargeTypeId = CacheManager.TypesCache.Get <ServiceChargeType>(ServiceChargeTypeEnum.Free.ToString()),
                     ChargeDescription = DESCRIPTION_FI,
                     LocalizationId = fiId
                 }
             },
             new OrganizationPhone
             {
                 Phone = new Phone
                 {
                     TypeId = CacheManager.TypesCache.Get <PhoneNumberType>(PhoneNumberTypeEnum.Phone.ToString()),
                     Number = PHONE_NUMBER,
                     PrefixNumber = new DialCode()
                     {
                         Code = PHONE_PREFIX
                     },
                     ChargeTypeId = CacheManager.TypesCache.Get <ServiceChargeType>(ServiceChargeTypeEnum.Charged.ToString()),
                     ChargeDescription = DESCRIPTION_SV,
                     LocalizationId = svId
                 }
             }
         },
         OrganizationEmails = new List <OrganizationEmail>
         {
             new OrganizationEmail
             {
                 Email = new Email
                 {
                     LocalizationId = CacheManager.LanguageCache.Get(LanguageCode.fi.ToString()),
                     Value = EMAIL_FI,
                     Description = DESCRIPTION_FI
                 }
             },
             new OrganizationEmail
             {
                 Email = new Email
                 {
                     LocalizationId = CacheManager.LanguageCache.Get(LanguageCode.sv.ToString()),
                     Value = EMAIL_FI,
                     Description = DESCRIPTION_SV
                 }
             }
         },
         OrganizationWebAddress = new List <OrganizationWebPage>
         {
             new OrganizationWebPage
             {
                 WebPage = TestDataFactory.CreateWebPage()
             }
         },
         UnificRoot = new Organization {
             OrganizationServices = CreateOrganizationServices(), ServiceProducerOrganizations = CreateServiceProducerOrganization()
         }
     });
 }
Esempio n. 12
0
        public OpenApiServiceRequirementTranslatorTest()
        {
            var languageCacheMock = new Mock <ILanguageCache>();

            languageCacheMock.Setup(i => i.Filter(It.IsAny <Guid>(), It.IsAny <LanguageCode>())).Returns(true);
            languageCacheMock.Setup(i => i.Filter(It.IsAny <List <ILocalizable> >(), It.IsAny <LanguageCode>())).Returns((List <ILocalizable> i) => i.FirstOrDefault());
            var languageCache = languageCacheMock.Object;

            var unitOfWorkMockSetup = new Mock <IUnitOfWork>();

            unitOfWorkMock = unitOfWorkMockSetup.Object;

            translators = new List <object>
            {
                new OpenApiServiceRequirementTranslator(ResolveManager, TranslationPrimitives, languageCache),
                RegisterTranslatorMock(new Mock <ITranslator <Language, string> >(), unitOfWorkMock, language => TestDataFactory.LocalizationFi()),
            };
        }