Exemple #1
0
        public void ConvertAndSave_LocalizedStateName()
        {
            CultureInfo[] cultures = CreateCultureInfos("de", "en");
            LocalizingMetadataConverter converter = new LocalizingMetadataConverter(_localizationConverter, cultures);
            string               filename         = "metadata.xml";
            MetadataCache        cache            = new MetadataCache();
            List <EnumValueInfo> states           = new List <EnumValueInfo> ();

            states.Add(new EnumValueInfo("Remotion.Security.UnitTests.TestDomain.FileState", "Archived", 2));
            StatePropertyInfo propertyInfo = AddStatePropertyInfo(cache, typeof(PaperFile), "State", "00000000-0000-0000-0002-000000000001", states);

            string stateDescription = propertyInfo.Description + "|Archived";

            LocalizedName[] expectedGermanNames = new LocalizedName[] {
                CreateLocalizedName(propertyInfo),
                CreateLocalizedName(propertyInfo, 0, stateDescription)
            };

            _localizationConverter.ConvertAndSave(expectedGermanNames, cultures[0], filename);

            LocalizedName[] expectedEnglishNames = new LocalizedName[] {
                CreateLocalizedName(propertyInfo),
                CreateLocalizedName(propertyInfo, 0, stateDescription)
            };
            _localizationConverter.ConvertAndSave(expectedEnglishNames, cultures[1], filename);
            _mocks.ReplayAll();

            converter.ConvertAndSave(cache, filename);

            _mocks.VerifyAll();
        }
Exemple #2
0
        /// <summary>
        /// Returns true if Location instances are equal
        /// </summary>
        /// <param name="input">Instance of Location to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Location?input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     LocalizedName == input.LocalizedName ||
                     (LocalizedName != null &&
                      LocalizedName.Equals(input.LocalizedName))
                     ) &&
                 (
                     Id == input.Id ||
                     Id.Equals(input.Id)
                 ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     IsCountry == input.IsCountry ||
                     IsCountry.Equals(input.IsCountry)
                 ) &&
                 (
                     CountryCode == input.CountryCode ||
                     (CountryCode != null &&
                      CountryCode.Equals(input.CountryCode))
                 ));
        }
Exemple #3
0
        public MaidEntity()
        {
            Documents         = new List <MaidDocumentEntity>();
            EmploymentHistory = new List <MaidEmploymentHistoryEntity>();
            Languages         = new List <MaidLanguageEntity>();
            Skills            = new List <MaidSkillEntity>();
            Note = new LocalizedName(null, null);

            Passport = new MaidPassportDetailEntity();
        }
        /// <summary>
        /// Check equality based on is localized name
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            var item = obj as EnglishLanguage;

            if (item == null)
            {
                return(false);
            }

            return(LocalizedName.Equals(item.LocalizedName));
        }
        public void Convert_Empty()
        {
            LocalizedName[] localizedNames = new LocalizedName[0];
            MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter();

            XmlDocument document = converter.Convert(localizedNames, "de");

            string expectedXml = @"<?xml version=""1.0""?>
          <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture=""de"" />
          ";

            XmlAssert.AreDocumentsEqual(expectedXml, document);
        }
Exemple #6
0
 public void MergeFrom(CouponCampaign other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.localizedName_ != null)
     {
         if (localizedName_ == null)
         {
             LocalizedName = new global::PKIo.LocalizedString();
         }
         LocalizedName.MergeFrom(other.LocalizedName);
     }
     status_.Add(other.status_);
     if (other.PassTypeIdentifier.Length != 0)
     {
         PassTypeIdentifier = other.PassTypeIdentifier;
     }
     if (other.IanaTimezone.Length != 0)
     {
         IanaTimezone = other.IanaTimezone;
     }
     if (other.created_ != null)
     {
         if (created_ == null)
         {
             Created = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         Created.MergeFrom(other.Created);
     }
     if (other.updated_ != null)
     {
         if (updated_ == null)
         {
             Updated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         Updated.MergeFrom(other.Updated);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemple #7
0
        public void CreateAndCommitSecurableClassDefinitionWithLocalizedNames(ClientTransaction transaction)
        {
            CreateEmptyDomain();

            using (transaction.EnterNonDiscardingScope())
            {
                SecurableClassDefinition classDefinition = CreateOrderSecurableClassDefinition();

                Culture germanCulture  = Culture.NewObject("de");
                Culture englishCulture = Culture.NewObject("en");
                Culture russianCulture = Culture.NewObject("ru");

                LocalizedName classInGerman  = LocalizedName.NewObject("Klasse", germanCulture, classDefinition);
                LocalizedName classInEnglish = LocalizedName.NewObject("Class", englishCulture, classDefinition);

                ClientTransactionScope.CurrentTransaction.Commit();
            }
        }
        public void Convert_OneLocalizedNameForInvariantCulture()
        {
            LocalizedName[] localizedNames = new LocalizedName[1];
            localizedNames[0] = new LocalizedName("b8621bc9-9ab3-4524-b1e4-582657d6b420", "Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain", "Beamter");

            MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter();

            XmlDocument document = converter.Convert(localizedNames, CultureInfo.InvariantCulture.Name);

            string expectedXml = @"<?xml version=""1.0""?>
          <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture="""">
            <localizedName ref=""b8621bc9-9ab3-4524-b1e4-582657d6b420"" comment=""Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain"">
    Beamter
  </localizedName>
          </localizedNames>
          ";

            XmlAssert.AreDocumentsEqual(expectedXml, document);
        }
Exemple #9
0
        public void AddTown(string nameRussian, string NameEnglish, double latitude, double longitude)
        {
            var localizedName = new LocalizedName()
            {
                Russian = nameRussian,
                English = NameEnglish,
            };

            var town = new Town()
            {
                Name      = localizedName,
                Latitude  = latitude,
                Longitude = longitude,
            };

            _context.Towns.Add(town);

            _context.SaveChanges();
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (HasId)
            {
                hash ^= Id.GetHashCode();
            }
            if (HasCountryCode)
            {
                hash ^= CountryCode.GetHashCode();
            }
            if (HasProductBiddingCategoryConstantParent)
            {
                hash ^= ProductBiddingCategoryConstantParent.GetHashCode();
            }
            if (Level != global::Google.Ads.GoogleAds.V6.Enums.ProductBiddingCategoryLevelEnum.Types.ProductBiddingCategoryLevel.Unspecified)
            {
                hash ^= Level.GetHashCode();
            }
            if (Status != global::Google.Ads.GoogleAds.V6.Enums.ProductBiddingCategoryStatusEnum.Types.ProductBiddingCategoryStatus.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (HasLanguageCode)
            {
                hash ^= LanguageCode.GetHashCode();
            }
            if (HasLocalizedName)
            {
                hash ^= LocalizedName.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #11
0
        public void ConvertAndSave_LocalizedStatePropertyName()
        {
            CultureInfo[] cultures = CreateCultureInfos("de", "en");
            LocalizingMetadataConverter converter = new LocalizingMetadataConverter(_localizationConverter, cultures);
            string            filename            = "metadata.xml";
            MetadataCache     cache        = new MetadataCache();
            StatePropertyInfo propertyInfo = AddStatePropertyInfo(cache, typeof(PaperFile), "State", "00000000-0000-0000-0002-000000000001", new List <EnumValueInfo> ());

            LocalizedName expectedGermanName = CreateLocalizedName(propertyInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedGermanName }, cultures[0], filename);
            LocalizedName expectedEnglishName = CreateLocalizedName(propertyInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedEnglishName }, cultures[1], filename);
            _mocks.ReplayAll();

            converter.ConvertAndSave(cache, filename);

            _mocks.VerifyAll();
        }
Exemple #12
0
        public void ConvertAndSave_LocalizedClassName()
        {
            CultureInfo[] cultures = CreateCultureInfos("de", "en");
            LocalizingMetadataConverter converter = new LocalizingMetadataConverter(_localizationConverter, cultures);
            string             filename           = "metadata.xml";
            MetadataCache      cache     = new MetadataCache();
            SecurableClassInfo classInfo = AddSecurableClassInfo(cache, typeof(SecurableObject), "21df1db3-affd-4c1a-b14e-340c1405bd69");

            LocalizedName expectedGermanName = CreateLocalizedName(classInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedGermanName }, cultures[0], filename);
            LocalizedName expectedEnglishName = CreateLocalizedName(classInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedEnglishName }, cultures[1], filename);
            _mocks.ReplayAll();

            converter.ConvertAndSave(cache, filename);

            _mocks.VerifyAll();
        }
Exemple #13
0
        public void ConvertAndSave_LocalizedAbstractRoleName()
        {
            CultureInfo[] cultures = CreateCultureInfos("de", "en");
            LocalizingMetadataConverter converter = new LocalizingMetadataConverter(_localizationConverter, cultures);
            string        filename         = "metadata.xml";
            MetadataCache cache            = new MetadataCache();
            EnumValueInfo abstractRoleInfo = AddAbstractRoleInfo(cache, TestAbstractRoles.Developer, "6aba5c1a-cf54-4a12-9523-204fe0b56fd5", "Developer", "Remotion.Security.UnitTests.Core.SampleDomain.TestAbstractRoles", 0);

            LocalizedName expectedGermanName = CreateLocalizedName(abstractRoleInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedGermanName }, cultures[0], filename);
            LocalizedName expectedEnglishName = CreateLocalizedName(abstractRoleInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedEnglishName }, cultures[1], filename);
            _mocks.ReplayAll();

            converter.ConvertAndSave(cache, filename);

            _mocks.VerifyAll();
        }
Exemple #14
0
        public void ConvertAndSave_LocalizedAccessTypeName()
        {
            CultureInfo[] cultures = CreateCultureInfos("de", "en");
            LocalizingMetadataConverter converter = new LocalizingMetadataConverter(_localizationConverter, cultures);
            string        filename       = "metadata.xml";
            MetadataCache cache          = new MetadataCache();
            EnumValueInfo accessTypeInfo = AddAccessTypeInfo(cache, TestAccessTypes.First, "31ba143f-bef0-442b-a6dd-3b36a390e639", "First", "Remotion.Security.UnitTests.Core.SampleDomain.TestAccessTypes", 1);

            LocalizedName expectedGermanName = CreateLocalizedName(accessTypeInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedGermanName }, cultures[0], filename);
            LocalizedName expectedEnglishName = CreateLocalizedName(accessTypeInfo);

            _localizationConverter.ConvertAndSave(new LocalizedName[] { expectedEnglishName }, cultures[1], filename);
            _mocks.ReplayAll();

            converter.ConvertAndSave(cache, filename);

            _mocks.VerifyAll();
        }
Exemple #15
0
        public bool Equals(PartnerOfferHistoryResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     PartnerOfferKey == input.PartnerOfferKey ||
                     (PartnerOfferKey != null && PartnerOfferKey.Equals(input.PartnerOfferKey))
                     ) &&
                 (
                     MembershipId == input.MembershipId ||
                     (MembershipId.Equals(input.MembershipId))
                 ) &&
                 (
                     MembershipType == input.MembershipType ||
                     (MembershipType.Equals(input.MembershipType))
                 ) &&
                 (
                     LocalizedName == input.LocalizedName ||
                     (LocalizedName != null && LocalizedName.Equals(input.LocalizedName))
                 ) &&
                 (
                     LocalizedDescription == input.LocalizedDescription ||
                     (LocalizedDescription != null && LocalizedDescription.Equals(input.LocalizedDescription))
                 ) &&
                 (
                     IsConsumable == input.IsConsumable ||
                     (IsConsumable != null && IsConsumable.Equals(input.IsConsumable))
                 ) &&
                 (
                     QuantityApplied == input.QuantityApplied ||
                     (QuantityApplied.Equals(input.QuantityApplied))
                 ) &&
                 (
                     ApplyDate == input.ApplyDate ||
                     (ApplyDate != null && ApplyDate.Equals(input.ApplyDate))
                 ));
        }
Exemple #16
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (localizedName_ != null)
            {
                hash ^= LocalizedName.GetHashCode();
            }
            hash ^= status_.GetHashCode();
            if (PassTypeIdentifier.Length != 0)
            {
                hash ^= PassTypeIdentifier.GetHashCode();
            }
            if (IanaTimezone.Length != 0)
            {
                hash ^= IanaTimezone.GetHashCode();
            }
            if (created_ != null)
            {
                hash ^= Created.GetHashCode();
            }
            if (updated_ != null)
            {
                hash ^= Updated.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public void Convert_TwoLocalizedNames()
        {
            LocalizedName[] localizedNames = new LocalizedName[2];
            localizedNames[0] = new LocalizedName("b8621bc9-9ab3-4524-b1e4-582657d6b420", "Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain", "Beamter");
            localizedNames[1] = new LocalizedName("93969f13-65d7-49f4-a456-a1686a4de3de", "Confidentiality", "Vertraulichkeit");

            MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter();

            XmlDocument document = converter.Convert(localizedNames, "de");

            string expectedXml = @"<?xml version=""1.0""?>
          <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture=""de"">
            <localizedName ref=""b8621bc9-9ab3-4524-b1e4-582657d6b420"" comment=""Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain"">
    Beamter
  </localizedName>
            <localizedName ref=""93969f13-65d7-49f4-a456-a1686a4de3de"" comment=""Confidentiality"">
    Vertraulichkeit
  </localizedName>
          </localizedNames>
          ";

            XmlAssert.AreDocumentsEqual(expectedXml, document);
        }
Exemple #18
0
        public bool Equals(PartnerOfferSkuHistoryResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     SkuIdentifier == input.SkuIdentifier ||
                     (SkuIdentifier != null && SkuIdentifier.Equals(input.SkuIdentifier))
                     ) &&
                 (
                     LocalizedName == input.LocalizedName ||
                     (LocalizedName != null && LocalizedName.Equals(input.LocalizedName))
                 ) &&
                 (
                     LocalizedDescription == input.LocalizedDescription ||
                     (LocalizedDescription != null && LocalizedDescription.Equals(input.LocalizedDescription))
                 ) &&
                 (
                     ClaimDate == input.ClaimDate ||
                     (ClaimDate != null && ClaimDate.Equals(input.ClaimDate))
                 ) &&
                 (
                     AllOffersApplied == input.AllOffersApplied ||
                     (AllOffersApplied != null && AllOffersApplied.Equals(input.AllOffersApplied))
                 ) &&
                 (
                     TransactionId == input.TransactionId ||
                     (TransactionId != null && TransactionId.Equals(input.TransactionId))
                 ) &&
                 (
                     SkuOffers == input.SkuOffers ||
                     (SkuOffers != null && SkuOffers.SequenceEqual(input.SkuOffers))
                 ));
        }
Exemple #19
0
 public void DomainObjectsAreSerializable()
 {
     CheckDomainObjectSerializability(delegate { return(AccessControlEntry.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StatefulAccessControlList.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(Permission.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StateCombination.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StateUsage.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(AbstractRoleDefinition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(AccessTypeDefinition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(AccessTypeReference.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(Culture.NewObject("DE-DE")); });
     CheckDomainObjectSerializability(delegate { return(LocalizedName.NewObject("foo", Culture.NewObject("DE-DE"), SecurableClassDefinition.NewObject())); });
     CheckDomainObjectSerializability(delegate { return(SecurableClassDefinition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StateDefinition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StatePropertyDefinition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return(StatePropertyReference.NewObject()); });
     CheckDomainObjectSerializability(delegate { return((Group)LifetimeService.NewObject(ClientTransaction.Current, typeof(Group), ParamList.Empty)); });
     CheckDomainObjectSerializability(delegate { return((GroupType)LifetimeService.NewObject(ClientTransaction.Current, typeof(GroupType), ParamList.Empty)); });
     CheckDomainObjectSerializability(delegate { return(GroupTypePosition.NewObject()); });
     CheckDomainObjectSerializability(delegate { return((Position)LifetimeService.NewObject(ClientTransaction.Current, typeof(Position), ParamList.Empty)); });
     CheckDomainObjectSerializability(delegate { return(Role.NewObject()); });
     CheckDomainObjectSerializability(delegate { return((Tenant)LifetimeService.NewObject(ClientTransaction.Current, typeof(Tenant), ParamList.Empty)); });
     CheckDomainObjectSerializability(delegate { return((User)LifetimeService.NewObject(ClientTransaction.Current, typeof(User), ParamList.Empty)); });
 }
Exemple #20
0
 public AgencyEntity()
 {
     Address = new LocalizedName(string.Empty, string.Empty);
 }
Exemple #21
0
 private void LocalizeMetadataObjectEnDe(MetadataObject metadataObject, string nameEnglish, string nameGerman)
 {
     LocalizedName.NewObject(nameGerman, _cultureDe, metadataObject);
     LocalizedName.NewObject(nameEnglish, _cultureEn, metadataObject);
 }
Exemple #22
0
            public LogLine(string line)
            {
                MatchCollection matches = regex.Matches(line);
                source = matches[0].Groups[2].Value;
                target = matches[0].Groups[3].Value;
                ability = new LocalizedName(matches[0].Groups[4].Value);
                if (matches[0].Groups[5].Value.Contains(":"))
                {
                    event_type = new LocalizedName(matches[0].Groups[5].Value.Split(':')[0]);
                    event_detail = new LocalizedName(matches[0].Groups[5].Value.Split(':')[1]);
                }
                else
                {
                    event_type = new LocalizedName(matches[0].Groups[5].Value);
                    event_detail = LocalizedName.Empty;
                }

                crit_value = matches[0].Groups[6].Value.Contains("*");
                string[] raw_value = matches[0].Groups[6].Value.Replace("*", "").Split(' ');
                value = raw_value[0].Length > 0 ? int.Parse(raw_value[0]) : 0;
                if (raw_value.Length > 1)
                {
                    value_type = raw_value[1];
                }
                else
                {
                    value_type = "";
                }
                threat = matches[0].Groups[7].Value.Length > 0 ? int.Parse(matches[0].Groups[7].Value) : 0;
            }
Exemple #23
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (TierIndex != 0)
            {
                hash ^= TierIndex.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (localizedName_ != null)
            {
                hash ^= LocalizedName.GetHashCode();
            }
            if (SecondaryTierName.Length != 0)
            {
                hash ^= SecondaryTierName.GetHashCode();
            }
            if (localizedSecondaryTierName_ != null)
            {
                hash ^= LocalizedSecondaryTierName.GetHashCode();
            }
            if (ProgramId.Length != 0)
            {
                hash ^= ProgramId.GetHashCode();
            }
            if (PassTemplateId.Length != 0)
            {
                hash ^= PassTemplateId.GetHashCode();
            }
            if (TierUpgradeMessage.Length != 0)
            {
                hash ^= TierUpgradeMessage.GetHashCode();
            }
            if (localizedTierUpgradeMessage_ != null)
            {
                hash ^= LocalizedTierUpgradeMessage.GetHashCode();
            }
            if (TierDowngradeMessage.Length != 0)
            {
                hash ^= TierDowngradeMessage.GetHashCode();
            }
            if (localizedTierDowngradeMessage_ != null)
            {
                hash ^= LocalizedTierDowngradeMessage.GetHashCode();
            }
            if (created_ != null)
            {
                hash ^= Created.GetHashCode();
            }
            if (updated_ != null)
            {
                hash ^= Updated.GetHashCode();
            }
            if (PointsOverdrawn != false)
            {
                hash ^= PointsOverdrawn.GetHashCode();
            }
            if (SecondaryPointsOverdrawn != false)
            {
                hash ^= SecondaryPointsOverdrawn.GetHashCode();
            }
            if (expirySettings_ != null)
            {
                hash ^= ExpirySettings.GetHashCode();
            }
            if (Timezone.Length != 0)
            {
                hash ^= Timezone.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #24
0
 public void MergeFrom(Tier other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.TierIndex != 0)
     {
         TierIndex = other.TierIndex;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.localizedName_ != null)
     {
         if (localizedName_ == null)
         {
             LocalizedName = new global::PKIo.LocalizedString();
         }
         LocalizedName.MergeFrom(other.LocalizedName);
     }
     if (other.SecondaryTierName.Length != 0)
     {
         SecondaryTierName = other.SecondaryTierName;
     }
     if (other.localizedSecondaryTierName_ != null)
     {
         if (localizedSecondaryTierName_ == null)
         {
             LocalizedSecondaryTierName = new global::PKIo.LocalizedString();
         }
         LocalizedSecondaryTierName.MergeFrom(other.LocalizedSecondaryTierName);
     }
     if (other.ProgramId.Length != 0)
     {
         ProgramId = other.ProgramId;
     }
     if (other.PassTemplateId.Length != 0)
     {
         PassTemplateId = other.PassTemplateId;
     }
     if (other.TierUpgradeMessage.Length != 0)
     {
         TierUpgradeMessage = other.TierUpgradeMessage;
     }
     if (other.localizedTierUpgradeMessage_ != null)
     {
         if (localizedTierUpgradeMessage_ == null)
         {
             LocalizedTierUpgradeMessage = new global::PKIo.LocalizedString();
         }
         LocalizedTierUpgradeMessage.MergeFrom(other.LocalizedTierUpgradeMessage);
     }
     if (other.TierDowngradeMessage.Length != 0)
     {
         TierDowngradeMessage = other.TierDowngradeMessage;
     }
     if (other.localizedTierDowngradeMessage_ != null)
     {
         if (localizedTierDowngradeMessage_ == null)
         {
             LocalizedTierDowngradeMessage = new global::PKIo.LocalizedString();
         }
         LocalizedTierDowngradeMessage.MergeFrom(other.LocalizedTierDowngradeMessage);
     }
     if (other.created_ != null)
     {
         if (created_ == null)
         {
             Created = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         Created.MergeFrom(other.Created);
     }
     if (other.updated_ != null)
     {
         if (updated_ == null)
         {
             Updated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         Updated.MergeFrom(other.Updated);
     }
     if (other.PointsOverdrawn != false)
     {
         PointsOverdrawn = other.PointsOverdrawn;
     }
     if (other.SecondaryPointsOverdrawn != false)
     {
         SecondaryPointsOverdrawn = other.SecondaryPointsOverdrawn;
     }
     if (other.expirySettings_ != null)
     {
         if (expirySettings_ == null)
         {
             ExpirySettings = new global::PKIo.ExpirySettings();
         }
         ExpirySettings.MergeFrom(other.ExpirySettings);
     }
     if (other.Timezone.Length != 0)
     {
         Timezone = other.Timezone;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemple #25
0
        public void GetLocalizedName_ExistingCultureName()
        {
            LocalizedName expectedLocalizedName = CreateLocalizedName(_metadataObject, _cultureDe, "Class de");

            Assert.That(_metadataObject.GetLocalizedName("de"), Is.SameAs(expectedLocalizedName));
        }
Exemple #26
0
        public void GetLocalizedName_NotExistingCultureName()
        {
            LocalizedName localizedName = _metadataObject.GetLocalizedName("ru");

            Assert.That(localizedName, Is.Null);
        }
Exemple #27
0
 private LocalizedName CreateLocalizedName(MetadataObject metadataObject, Culture culture, string text)
 {
     return(LocalizedName.NewObject(text, culture, metadataObject));
 }
Exemple #28
0
 /// <summary>
 /// Get hash code based on it localized name
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     return(LocalizedName.GetHashCode());
 }
Exemple #29
0
        /// <summary>
        /// Check equality based on is localized name
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            var item = obj as FrenchLanguage;

            return(item != null && LocalizedName.Equals(item.LocalizedName));
        }
Exemple #30
0
 /// <summary>
 /// Get hash code based on it localized name
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode() => LocalizedName.GetHashCode();