private string GetSpeakablePhoneNumberType(PhoneNumberType phoneNumberType) { string speakableType; switch (phoneNumberType.Standardized) { case PhoneNumberType.StandardType.BUSINESS: speakableType = "Business"; break; case PhoneNumberType.StandardType.HOME: speakableType = "Home"; break; case PhoneNumberType.StandardType.MOBILE: speakableType = "Mobile"; break; case PhoneNumberType.StandardType.NONE: default: speakableType = phoneNumberType.FreeForm; break; } return(speakableType); }
public IHttpActionResult PostPhoneNumberType(PhoneNumberType phoneNumberType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PhoneNumberTypes.Add(phoneNumberType); try { db.SaveChanges(); } catch (DbUpdateException) { if (PhoneNumberTypeExists(phoneNumberType.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = phoneNumberType.ID }, phoneNumberType)); }
public IEnumerable<VoipPhone> GetAvailablePhoneNumbers(PhoneNumberType numberType, string isoCountryCode) { if (!CRMSecurity.IsAdmin) throw CRMSecurity.CreateSecurityException(); if (string.IsNullOrEmpty(isoCountryCode)) throw new ArgumentException(); return VoipProvider.GetAvailablePhoneNumbers(numberType, isoCountryCode); }
public IHttpActionResult PutPhoneNumberType(int id, PhoneNumberType phoneNumberType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != phoneNumberType.ID) { return(BadRequest()); } db.Entry(phoneNumberType).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PhoneNumberTypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void Constructor() { PhoneNumberType phoneNumberType; phoneNumberType = new PhoneNumberType(1, "Test", 1, DataContextTest.GetOneDataContext()); Assert.IsNotNull(phoneNumberType); }
public void PhoneNumberValidatorIsValidTestNoInputReturnsFalse(PhoneNumberType type, string input) { var ctx = CreateContext(input); var sut = new PhoneNumberValidator <Dummy>(type); sut.IsValid(ctx, input).Should().BeFalse(); }
private void AssertDefault(string number, PhoneNumberType type) { Assert.AreEqual(number, _phoneNumberTextBox.Text); Assert.AreEqual(type == PhoneNumberType.Mobile, _mobileRadioButton.IsChecked); Assert.AreEqual(type == PhoneNumberType.Home, _homeRadioButton.IsChecked); Assert.AreEqual(type == PhoneNumberType.Work, _workRadioButton.IsChecked); }
public PhoneNumberType GetByID(int _phoneNumberTypeId) { PhoneNumberTypeDAC _phoneNumberTypeComponent = new PhoneNumberTypeDAC(); IDataReader reader = _phoneNumberTypeComponent.GetByIDPhoneNumberType(_phoneNumberTypeId); PhoneNumberType _phoneNumberType = null; while (reader.Read()) { _phoneNumberType = new PhoneNumberType(); if (reader["PhoneNumberTypeId"] != DBNull.Value) { _phoneNumberType.PhoneNumberTypeId = Convert.ToInt32(reader["PhoneNumberTypeId"]); } if (reader["Name"] != DBNull.Value) { _phoneNumberType.Name = Convert.ToString(reader["Name"]); } if (reader["ModifiedDate"] != DBNull.Value) { _phoneNumberType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); } _phoneNumberType.NewRecord = false; } reader.Close(); return(_phoneNumberType); }
public void IsPhoneNumberTestNullRuleBuilderThrows(PhoneNumberType type) { IRuleBuilder <Dummy, string> ruleBuilder = null; Func <IRuleBuilderOptions <Dummy, string> > func = () => ruleBuilder.IsPhoneNumber(type); func.Should().Throw <ArgumentNullException>(); }
public List <PhoneNumberType> GetAll() { PhoneNumberTypeDAC _phoneNumberTypeComponent = new PhoneNumberTypeDAC(); IDataReader reader = _phoneNumberTypeComponent.GetAllPhoneNumberType().CreateDataReader(); List <PhoneNumberType> _phoneNumberTypeList = new List <PhoneNumberType>(); while (reader.Read()) { if (_phoneNumberTypeList == null) { _phoneNumberTypeList = new List <PhoneNumberType>(); } PhoneNumberType _phoneNumberType = new PhoneNumberType(); if (reader["PhoneNumberTypeId"] != DBNull.Value) { _phoneNumberType.PhoneNumberTypeId = Convert.ToInt32(reader["PhoneNumberTypeId"]); } if (reader["Name"] != DBNull.Value) { _phoneNumberType.Name = Convert.ToString(reader["Name"]); } if (reader["ModifiedDate"] != DBNull.Value) { _phoneNumberType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); } _phoneNumberType.NewRecord = false; _phoneNumberTypeList.Add(_phoneNumberType); } reader.Close(); return(_phoneNumberTypeList); }
/** * @param exampleNumberRequestedType type we are requesting an example number for * @param possibleExpectedTypes acceptable types that this number should match, such as * FIXED_LINE and FIXED_LINE_OR_MOBILE for a fixed line example number. */ private void checkNumbersValidAndCorrectType(PhoneNumberType exampleNumberRequestedType, HashSet<PhoneNumberType> possibleExpectedTypes) { foreach (var regionCode in phoneNumberUtil.GetSupportedRegions()) { PhoneNumber exampleNumber = phoneNumberUtil.GetExampleNumberForType(regionCode, exampleNumberRequestedType); if (exampleNumber != null) { if (!phoneNumberUtil.IsValidNumber(exampleNumber)) { invalidCases.Add(exampleNumber); //LOGGER.log(Level.SEVERE, "Failed validation for " + exampleNumber.toString()); } else { // We know the number is valid, now we check the type. PhoneNumberType exampleNumberType = phoneNumberUtil.GetNumberType(exampleNumber); if (!possibleExpectedTypes.Contains(exampleNumberType)) { wrongTypeCases.Add(exampleNumber); //LOGGER.log(Level.SEVERE, "Wrong type for " + exampleNumber.toString() + ": got " + exampleNumberType); //LOGGER.log(Level.WARNING, "Expected types: "); //for (PhoneNumberType type : possibleExpectedTypes) { //LOGGER.log(Level.WARNING, type.toString()); } } } } }
public PhoneNumber(CountryCode countryCode, string areaCode, string number, PhoneNumberType phoneNumberType) { AreaCode = areaCode; Number = number; PhoneNumberType = phoneNumberType; CountryCode = countryCode; }
public async Task TestDelete_PhoneNumberDoesNotExist() { using (ShimsContext.Create()) { System.Data.Entity.Fakes.ShimDbContext.AllInstances.SetOf1 <Person>((c) => { return(context.People); }); var phoneNumberType = new PhoneNumberType { PhoneNumberTypeId = PhoneNumberType.Home.Id, PhoneNumberTypeName = PhoneNumberType.Home.Value }; Action beforeTester = () => { Assert.AreEqual(0, context.PhoneNumbers.Count()); }; Action afterTester = () => { Assert.AreEqual(0, context.PhoneNumbers.Count()); }; context.SetupActions.Add(() => { context.PhoneNumberTypes.Add(phoneNumberType); }); context.Revert(); beforeTester(); Action a = () => service.Delete(1); Func <Task> f = () => service.DeleteAsync(1); a.ShouldNotThrow(); f.ShouldNotThrow(); beforeTester(); } }
public static PhoneNumber Create(string phoneNumber, PhoneNumberType phoneNumberType) { const int AREA_CODE_LENGTH = 3; const int MINIMUM_PHONE_NUMBER_LENGTH = 10; const int MAXIMUM_PHONE_NUMBER_LENGTH = 13; if (string.IsNullOrEmpty(phoneNumber)) { return(new PhoneNumber(string.Empty, string.Empty, PhoneNumberType.Unknown)); } string filteredNumber = Regex.Replace(phoneNumber, "\\D", ""); if (filteredNumber.Length < MINIMUM_PHONE_NUMBER_LENGTH || filteredNumber.Length > MAXIMUM_PHONE_NUMBER_LENGTH) { return(new PhoneNumber(string.Empty, string.Empty, PhoneNumberType.Unknown)); } int countryCodeLength = filteredNumber.Length - MINIMUM_PHONE_NUMBER_LENGTH; CountryCode countryCode = (countryCodeLength > 0) ? (CountryCode)(int.Parse(filteredNumber.Substring(0, countryCodeLength))) : CountryCode.UnitedStatesAndCanada; string areaCode = filteredNumber.Substring(countryCodeLength, AREA_CODE_LENGTH); string number = filteredNumber.Substring(countryCodeLength + AREA_CODE_LENGTH, filteredNumber.Length - countryCodeLength - AREA_CODE_LENGTH); return(new PhoneNumber(countryCode, areaCode, number, phoneNumberType)); }
public async Task TestCreate_PersonDoesNotExist() { using (ShimsContext.Create()) { System.Data.Entity.Fakes.ShimDbContext.AllInstances.SetOf1 <Person>((c) => { return(context.People); }); var userId = 1; var personId = 10; var phoneNumberType = new PhoneNumberType { PhoneNumberTypeId = PhoneNumberType.Home.Id, PhoneNumberTypeName = PhoneNumberType.Home.Value }; var user = new User(userId); var newPhone = new NewPersonPhoneNumber(user, phoneNumberType.PhoneNumberTypeId, "1234", "123", personId, true); context.SetupActions.Add(() => { context.PhoneNumberTypes.Add(phoneNumberType); }); var message = String.Format("The phoneNumberable entity with id [{0}] was not found.", personId); context.Revert(); Action a = () => service.Create(newPhone); Func <Task> f = () => service.CreateAsync(newPhone); a.ShouldThrow <ModelNotFoundException>().WithMessage(message); f.ShouldThrow <ModelNotFoundException>().WithMessage(message); } }
public async Task TestUpdate_PhoneNumberDoesNotExist() { using (ShimsContext.Create()) { System.Data.Entity.Fakes.ShimDbContext.AllInstances.SetOf1 <Person>((c) => { return(context.People); }); var yesterday = DateTimeOffset.Now.AddDays(-1.0); var user = new User(5); var phoneNumberId = 10; PhoneNumberType type = new PhoneNumberType { PhoneNumberTypeId = PhoneNumberType.Home.Id, PhoneNumberTypeName = PhoneNumberType.Home.Value }; var number = "12345"; var ext = "123"; var isPrimary = true; var updatedPhone = new UpdatedPhoneNumber(user, phoneNumberId, number, ext, type.PhoneNumberTypeId, isPrimary); Action a = () => service.Update(updatedPhone); Func <Task> f = () => service.UpdateAsync(updatedPhone); var message = String.Format("The phone number with id [{0}] was not found.", phoneNumberId); a.ShouldThrow <ModelNotFoundException>().WithMessage(message); f.ShouldThrow <ModelNotFoundException>().WithMessage(message); } }
public void PhoneNumberValidatorConstructorTest(PhoneNumberType type) { var sut = new PhoneNumberValidator <Dummy>(type); sut.Name.Should().Be("PhoneNumberValidator"); sut.Type.Should().Be(type); }
/** * @param exampleNumberRequestedType type we are requesting an example number for * @param possibleExpectedTypes acceptable types that this number should match, such as * FIXED_LINE and FIXED_LINE_OR_MOBILE for a fixed line example number. */ private void checkNumbersValidAndCorrectType(PhoneNumberType exampleNumberRequestedType, HashSet <PhoneNumberType> possibleExpectedTypes) { foreach (var regionCode in phoneNumberUtil.GetSupportedRegions()) { PhoneNumber exampleNumber = phoneNumberUtil.GetExampleNumberForType(regionCode, exampleNumberRequestedType); if (exampleNumber != null) { if (!phoneNumberUtil.IsValidNumber(exampleNumber)) { invalidCases.Add(exampleNumber); //LOGGER.log(Level.SEVERE, "Failed validation for " + exampleNumber.toString()); } else { // We know the number is valid, now we check the type. PhoneNumberType exampleNumberType = phoneNumberUtil.GetNumberType(exampleNumber); if (!possibleExpectedTypes.Contains(exampleNumberType)) { wrongTypeCases.Add(exampleNumber); //LOGGER.log(Level.SEVERE, "Wrong type for " + exampleNumber.toString() + ": got " + exampleNumberType); //LOGGER.log(Level.WARNING, "Expected types: "); //for (PhoneNumberType type : possibleExpectedTypes) { //LOGGER.log(Level.WARNING, type.toString()); } } } } }
public override bool IsValid(object value) { if (value is string phoneNumber) { PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.GetInstance(); CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; RegionInfo regionInfo = new RegionInfo(cultureInfo.Name); PhoneNumber phoneNumberObj = phoneNumberUtil.Parse(phoneNumber, regionInfo.TwoLetterISORegionName); bool result = phoneNumberUtil.IsValidNumber(phoneNumberObj); if (result && (AcceptFixedNumbersOnly || AcceptMobileNumbersOnly)) { PhoneNumberType numberType = phoneNumberUtil.GetNumberType(phoneNumberObj); if (AcceptFixedNumbersOnly) { result = numberType == PhoneNumberType.FIXED_LINE || numberType == PhoneNumberType.FIXED_LINE_OR_MOBILE; } else { result = numberType == PhoneNumberType.FIXED_LINE_OR_MOBILE || numberType == PhoneNumberType.MOBILE; } } return(result); } else { return(false); } }
public IEnumerable <VoipPhone> GetAvailablePhoneNumbers(PhoneNumberType phoneNumberType, string isoCountryCode) { var result = new AvailablePhoneNumberResult(); var request = new AvailablePhoneNumberListRequest { VoiceEnabled = true }; switch (phoneNumberType) { case PhoneNumberType.Local: result = client.ListAvailableLocalPhoneNumbers(isoCountryCode, request); break; /* case PhoneNumberType.Mobile: * result = twilio.ListAvailableMobilePhoneNumbers(isoCountryCode, request); * break;*/ case PhoneNumberType.TollFree: result = client.ListAvailableTollFreePhoneNumbers(isoCountryCode); break; } ThrowIfError(result); return(result.AvailablePhoneNumbers.Select(r => new TwilioPhone(client) { Number = r.PhoneNumber })); }
public void CreatePhoneNumberSetsPhoneNumberTypeToGivenType() { const PhoneNumberType expectedPhoneNumberType = PhoneNumberType.Mobile; PhoneNumber phoneNumber = _factory.CreatePhoneNumber("000-000-00000", expectedPhoneNumberType); Assert.AreEqual(expectedPhoneNumberType, phoneNumber.PhoneNumberType); }
private PhoneNumberType GetPhoneNumberType(Boolean refresh) { if (_phoneNumberType.IsNull() || refresh) { _phoneNumberType = new PhoneNumberType(1, "Test", 1, DataContextTest.GetOneDataContext()); } return(_phoneNumberType); }
public void SetUp() { PhoneNumberType differentTypeOfPhoneNumber = PhoneNumberType.Mobile; string number = "+1 (234) 567-8901"; phoneNumber = new PhoneNumber(number); samePhoneNumber = new PhoneNumber(number); differentPhoneNumber = new PhoneNumber(differentTypeOfPhoneNumber, number); }
public void AddPhoneNumber(PhoneNumberType type, string number) { if (_phoneNumbers == null) { _phoneNumbers = new List <PhoneNumber>(1); } _phoneNumbers.Add(PhoneNumber.Create(type, number)); }
public string GetPhoneNumber(PhoneNumberType phoneNumberType) { LastGenerated = phoneNumberType == PhoneNumberType.Domestic ? $"{GetRandNumString(3)}-{GetRandNumString(3)}-{GetRandNumString(4)}-{GetRandNumString(4)}" : //011 55 11 2345678 $"011-{GetRandNumString(2)}-{GetRandNumString(2)}-{GetRandNumString(7)}"; string phoneGen = LastGenerated; return(phoneGen); }
public void IsPhoneNumberTestCreatesValidator(PhoneNumberType type) { _validator.RuleFor(x => x.StringVal).IsPhoneNumber(type); var rule = (IValidationRule <Dummy>)_validator.First(); Assert.IsType <PhoneNumberValidator <Dummy> >(rule.Components.LastOrDefault()?.Validator); rule.Member.Name.Should().Be("StringVal"); }
private bool DoPhoneNumberTypesMatch(PhoneNumberType requestedType, PhoneNumberType actualType) { if (requestedType.Standardized != PhoneNumberType.StandardType.NONE) { return(requestedType.Standardized == actualType.Standardized); } return(PreProcess(requestedType.FreeForm).Equals(PreProcess(actualType.FreeForm), StringComparison.OrdinalIgnoreCase)); }
private static PhoneNumber GetPhoneNumber(IMember view, PhoneNumberType type) { if (view.PhoneNumbers == null) { return(null); } var phoneNumber = (from p in view.PhoneNumbers where p.Type == type && !string.IsNullOrEmpty(p.Number) select p).FirstOrDefault(); return(phoneNumber == null || string.IsNullOrEmpty(phoneNumber.Number) ? null : phoneNumber); }
public static PhoneNumberType ToDomain(this PhoneNumberTypeModel model, PhoneNumberType domain) { if (model != null) { domain.Id = model.Id; domain.Type = model.Type; } return(domain); }
public static PhoneNumber GetPhoneNumber(this IMember member, PhoneNumberType type) { if (member.PhoneNumbers == null) { return(null); } var phoneNumber = (from p in member.PhoneNumbers where p.Type == type select p).FirstOrDefault(); return(phoneNumber == null || string.IsNullOrEmpty(phoneNumber.Number) ? null : phoneNumber); }
public IndividualConstituent GetIndividualConstituent(EmailType emailType, PhoneNumberType phoneNumberType, string parentConstId = "", bool confidential = false, bool includeInPrintDirectory = true, bool includeInMobileDirectory = true) { var name = _nameGen.GetName().Split(' '); var constituent = new IndividualConstituent( name[0], name[1], _addressGen.GetAddress(), _emailGen.GetEmailAddress(emailType), _phoneGen.GetPhoneNumber(phoneNumberType), LoremIpsumGenerator.GetWords(1), LoremIpsumGenerator.GetWords(1), LoremIpsumGenerator.GetWords(1), "Home", GetPrefix(), GetSuffix(), GetCredentials(), parentConstId, "", LoremIpsumGenerator.GetWords(2), LoremIpsumGenerator.GetWords(1), "", GetCountry(), confidential, includeInPrintDirectory, LoremIpsumGenerator.GetWords(3), includeInMobileDirectory); return(constituent); }
public virtual BOPhoneNumberType MapEFToBO( PhoneNumberType ef) { var bo = new BOPhoneNumberType(); bo.SetProperties( ef.PhoneNumberTypeID, ef.ModifiedDate, ef.Name); return(bo); }
// PUT api/awbuildversion/5 public void Put(PhoneNumberType value) { var GetActionType = Request.Headers.Where(x => x.Key.Equals("ActionType")).FirstOrDefault(); if (GetActionType.Key != null) { if (GetActionType.Value.ToList()[0].Equals("DELETE")) adventureWorks_BC.PhoneNumberTypeDelete(value); if (GetActionType.Value.ToList()[0].Equals("UPDATE")) adventureWorks_BC.PhoneNumberTypeUpdate(value); } }
private string FirstTelephoneNumber(Member member, PhoneNumberType phoneNumberType) { PhoneNumber phoneNumber = member.PhoneNumbers.FirstOrDefault(number => number.PhoneNumberType == phoneNumberType); return phoneNumber != null ? phoneNumber.Number : string.Empty; }
public IEnumerable<VoipPhone> GetAvailablePhoneNumbers(PhoneNumberType phoneNumberType, string isoCountryCode) { var result = new AvailablePhoneNumberResult(); var request = new AvailablePhoneNumberListRequest { VoiceEnabled = true }; switch (phoneNumberType) { case PhoneNumberType.Local: result = client.ListAvailableLocalPhoneNumbers(isoCountryCode, request); break; /* case PhoneNumberType.Mobile: result = twilio.ListAvailableMobilePhoneNumbers(isoCountryCode, request); break;*/ case PhoneNumberType.TollFree: result = client.ListAvailableTollFreePhoneNumbers(isoCountryCode); break; } ThrowIfError(result); return result.AvailablePhoneNumbers.Select(r => new VoipPhone { Number = r.PhoneNumber }); }
/// <summary> /// Gets a valid number for the specified region and number type. /// </summary> /// <param name="regionCode">the region for which an example number is needed</param> /// <param name="type">the type of number that is needed</param> /// <returns>a valid number for the specified region and type. Returns null when the metadata does not contain such information or if an invalid region or region 001 was entered. For 001 (representing non-geographical numbers), call {@link #getExampleNumberForNonGeoEntity} instead.</returns> public PhoneNumber GetExampleNumberForType(string regionCode, PhoneNumberType type) { return phoneNumberUtil.getExampleNumberForType(regionCode, (_PhoneNumberType)type); }
// POST api/awbuildversion public void Post(PhoneNumberType value) { adventureWorks_BC.PhoneNumberTypeAdd(value); }
/// <summary> /// Set MyBase to value of [dr] /// </summary> /// <param name="pconstring">data source connection string</param> /// <param name="dr">as data row</param> internal bool SetBase(string pconstring, DataRow dr) { try { if (dr["cntphID"] != System.DBNull.Value) { ID = Convert.ToInt16(dr["cntphID"].ToString()); } if (dr["cntid"] != System.DBNull.Value) { CNTID = new Guid(dr["cntid"].ToString()); } if (dr["cntphType"] != System.DBNull.Value) { Type = (PhoneNumberType)Convert.ToInt16(dr["cntphType"].ToString()); } if (dr["cntphAreaCode"] != System.DBNull.Value) { AreaCode = (String)dr["cntphAreaCode"]; } if (dr["cntphNumber"] != System.DBNull.Value) { Number = (String)dr["cntphNumber"]; } if (dr["cntphExt"] != System.DBNull.Value) { Extension = (String)dr["cntphExt"]; } return true; } catch (Exception ex) { GetLastError = ex; throw ex; } }
internal Immutable(PhoneNumber mutable) { Number = mutable.Number; Type = mutable.Type; }
/// <summary> /// Set MyBase /// </summary> /// <param name="pconstring">as data source connection string</param> /// <param name="data">as data.datarow</param> /// <returns></returns> internal bool SetBase(PhoneNumber data) { try { ID = data.ID; CNTID = data.CNTID; Type = data.Type; AreaCode = data.AreaCode; Number = data.Number; Extension = data.Extension; return true; } catch (Exception ex) { GetLastError = ex; throw ex; } }
PhoneNumberDesc GetNumberDescByType(PhoneMetadata metadata, PhoneNumberType type) { switch (type) { case PhoneNumberType.PREMIUM_RATE: return metadata.PremiumRate; case PhoneNumberType.TOLL_FREE: return metadata.TollFree; case PhoneNumberType.MOBILE: return metadata.Mobile; case PhoneNumberType.FIXED_LINE: case PhoneNumberType.FIXED_LINE_OR_MOBILE: return metadata.FixedLine; case PhoneNumberType.SHARED_COST: return metadata.SharedCost; case PhoneNumberType.VOIP: return metadata.Voip; case PhoneNumberType.PERSONAL_NUMBER: return metadata.PersonalNumber; case PhoneNumberType.PAGER: return metadata.Pager; case PhoneNumberType.UAN: return metadata.Uan; case PhoneNumberType.VOICEMAIL: return metadata.Voicemail; default: return metadata.GeneralDesc; } }
private PhoneNumber(Builder builder) { Number = builder.Number; Type = builder.Type; }
/** * Gets a valid number for the specified region and number type. * * @param regionCode region for which an example number is needed * @param type the type of number that is needed * @return a valid number for the specified region and type. Returns null when the metadata * does not contain such information or if an invalid region or region 001 was entered. * For 001 (representing non-geographical numbers), call * {@link #getExampleNumberForNonGeoEntity} instead. */ public PhoneNumber GetExampleNumberForType(String regionCode, PhoneNumberType type) { // Check the region code is valid. if (!IsValidRegionCode(regionCode)) return null; var desc = GetNumberDescByType(GetMetadataForRegion(regionCode), type); try { if (desc.HasExampleNumber) return Parse(desc.ExampleNumber, regionCode); } catch (NumberParseException) { } return null; }
private HashSet<PhoneNumberType> MakeSet(PhoneNumberType t1) { return MakeSet(t1, t1); }
public PhoneNumber(string number, PhoneNumberType type) { Number = number; Type = type; }
public PhoneNumber WithType(PhoneNumberType type) { return new PhoneNumber(Number, type); }
private HashSet<PhoneNumberType> MakeSet(PhoneNumberType t1, PhoneNumberType t2) { return new HashSet<PhoneNumberType>(new PhoneNumberType[] { t1, t2 }); }