Microsoft.Protocols.TestSuites.MS_OXWSCONT.TestSuiteBase.CreateFileAsMappingTypeContact C# (CSharp) Method

CreateFileAsMappingTypeContact() protected method

Create a contact item with enumeration value of FileAsMappingType.
protected CreateFileAsMappingTypeContact ( FileAsMappingType fileAsMappingType ) : ContactItemType
fileAsMappingType FileAsMappingType The enumeration value of FileAsMappingType.
return Microsoft.Protocols.TestSuites.Common.ContactItemType
        protected ContactItemType CreateFileAsMappingTypeContact(FileAsMappingType fileAsMappingType)
        {
            // Create a contact item type.
            ContactItemType item = new ContactItemType()
            {
                // Set the relevant properties on the contact.
                FileAsMapping = fileAsMappingType,
                FileAsMappingSpecified = true,

                // Set the information of complete name for the contact.
                DisplayName = Common.GenerateResourceName(
                        this.Site,
                        "DisplayName"),
                GivenName = Common.GenerateResourceName(
                        this.Site,
                        "GivenName"),
                MiddleName = Common.GenerateResourceName(
                        this.Site,
                        "MiddleName"),
                Surname = Common.GenerateResourceName(
                        this.Site,
                        "SurName"),
                Generation = Common.GenerateResourceName(
                        this.Site,
                        "SR."),

                // Set the information of company for the contact.
                Companies = new string[]
                {
                    Common.GenerateResourceName(
                        this.Site,
                        "Company")
                },

                CompanyName = Common.GenerateResourceName(
                        this.Site,
                        "Company"),
            };

            if (fileAsMappingType == FileAsMappingType.None)
            {
                item.FileAs = Common.GenerateResourceName(
                this.Site, "FirstContact");
            }

            return item;
        }