public ProfileData( string id, string name = null, string iconImageUrl = null, AccountStatus? status = null, string firstName = null, string lastName = null, string introduction = null, string braggingRights = null, string occupation = null, string greetingText = null, string nickName = null, RelationType? relationship = null, GenderType? genderType = null, LookingFor lookingFor = null, EmploymentInfo[] employments = null, EducationInfo[] educations = null, ContactInfo[] contactsInHome = null, ContactInfo[] contactsInWork = null, UrlInfo[] otherProfileUrls = null, UrlInfo[] contributeUrls = null, UrlInfo[] recommendedUrls = null, string[] placesLived = null, string[] otherNames = null, ProfileUpdateApiFlag loadedApiTypes = ProfileUpdateApiFlag.Unloaded, DateTime? lastUpdateLookupProfile = null, DateTime? lastUpdateProfileGet = null) { if (id == null) throw new ArgumentNullException("ProfileDataの引数idをnullにする事はできません。"); //idが数字になるならばProfileIdとして正しい。違うならばG+を始めていないアカウントのEMailAddressと見なす //また、スタブモード時は先頭に"Id"の2文字が入るため、テストコード用に先頭2文字を省いてParse()する。 double tmp; if (status == AccountStatus.Active && double.TryParse(id.Substring(2), out tmp) == false) throw new ArgumentException("ProfileDataの引数idがメアド状態で引数statusをActiveにする事はできません。"); LoadedApiTypes = loadedApiTypes; Status = status; Id = id; Name = name; FirstName = firstName; LastName = lastName; Introduction = introduction; BraggingRights = braggingRights; Occupation = occupation; GreetingText = greetingText; NickName = nickName; IconImageUrl = iconImageUrl; Relationship = relationship; Gender = genderType; LookingFor = lookingFor; Employments = employments; Educations = educations; ContactsInHome = contactsInHome; ContactsInWork = contactsInWork; OtherProfileUrls = otherProfileUrls; ContributeUrls = contributeUrls; RecommendedUrls = recommendedUrls; PlacesLived = placesLived; OtherNames = otherNames; LastUpdateLookupProfile = lastUpdateLookupProfile ?? DateTime.MinValue; LastUpdateProfileGet = lastUpdateProfileGet ?? DateTime.MinValue; }
ProfileData GenerateProfileData(int id, ProfileUpdateApiFlag apiType, string marking) { return StubGenerator.GenerateData<ProfileData>(marking, new { GenerateData_Id = id, LoadedApiTypes = StubGenerator.GenerateSetter(apiType), }); }