public void MSOXWSCORE_S02_TC04_UpdateContactItemSuccessfully() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyUpdateItemSuccessfulResponse(item); }
public void MSOXWSCONT_S01_TC05_VerifyContactItemWithImAddressKeyTypeEnums() { // The value count of enumeration "ImAddressKeyType" is 3. int enumCount = 3; ImAddressKeyType[] addressKeyTypes = new ImAddressKeyType[enumCount]; addressKeyTypes[0] = ImAddressKeyType.ImAddress1; addressKeyTypes[1] = ImAddressKeyType.ImAddress2; addressKeyTypes[2] = ImAddressKeyType.ImAddress3; // Define a contact array to store the contact items got from GetItem operation response. // Each contact should contain an ImAddressKeyType value as its element's value. ContactItemType[] contacts = new ContactItemType[enumCount]; for (int i = 0; i < enumCount; i++) { ImAddressKeyType addressKeyType = addressKeyTypes[i]; #region Step 1:Create the contact item with ImAddressKeyType // Create a contact item with ImAddressKeyType. ContactItemType item = this.BuildContactItemWithImAddress(addressKeyType); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Get the contact item. // The contact item to get. ItemIdType[] itemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemIds); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ContactItemType[] getItems = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One contact item should be returned!"); contacts[i] = getItems[0]; Site.Assert.IsNotNull( contacts[i], "The returned contact item should not be null."); Site.Assert.IsNotNull( contacts[i].ImAddresses, "The ImAddresses element in returned contact item should not be null."); Site.Assert.AreEqual<int>( 1, contacts[i].ImAddresses.GetLength(0), "One entry of ImAddresses element should be returned!"); #endregion } #region Capture Code this.Site.Assert.IsTrue( this.IsSchemaValidated, "The schema should be validated! Expected result: {0}, Actual result: {1}", true.ToString(), this.IsSchemaValidated.ToString()); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R151"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R151 Site.CaptureRequirementIfAreEqual<ImAddressKeyType>( ImAddressKeyType.ImAddress1, contacts[0].ImAddresses[0].Key, 151, @"[In t:ImAddressKeyType Simple Type] ImAddress1: Identifies the first instant messaging address for the user."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R152"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R152 Site.CaptureRequirementIfAreEqual<ImAddressKeyType>( ImAddressKeyType.ImAddress2, contacts[1].ImAddresses[0].Key, 152, @"[In t:ImAddressKeyType Simple Type] ImAddress2: Identifies the second instant messaging address for the user."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R153"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R153 Site.CaptureRequirementIfAreEqual<ImAddressKeyType>( ImAddressKeyType.ImAddress3, contacts[2].ImAddresses[0].Key, 153, @"[In t:ImAddressKeyType Simple Type] ImAddress3: Identifies the third instant messaging address for the user."); #endregion }
public void MSOXWSCONT_S01_TC08_VerifyContactItemWithPhysicalAddressKeyTypeEnums() { // The value count of enumeration "PhysicalAddressKeyType" is 3. int enumCount = 3; PhysicalAddressKeyType[] physicalAddressKeyTypes = new PhysicalAddressKeyType[enumCount]; physicalAddressKeyTypes[0] = PhysicalAddressKeyType.Business; physicalAddressKeyTypes[1] = PhysicalAddressKeyType.Home; physicalAddressKeyTypes[2] = PhysicalAddressKeyType.Other; // Define a contact array to store the contact items got from GetItem operation response. // Each contact should contain a PhysicalAddressKeyType value as its element's value. ContactItemType[] contacts = new ContactItemType[enumCount]; for (int i = 0; i < enumCount; i++) { PhysicalAddressKeyType physicalAddressKeyType = physicalAddressKeyTypes[i]; #region Step 1:Create the contact item with PhysicalAddressKeyType // Create a contact item with PhysicalAddressKeyType. ContactItemType item = this.BuildContactItemWithPhysicalAddress(physicalAddressKeyType); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Get the contact item. // The contact item to get. ItemIdType[] itemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemIds); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ContactItemType[] getItems = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One contact item should be returned!"); contacts[i] = getItems[0]; Site.Assert.IsNotNull( contacts[i], "The returned contact item should not be null."); Site.Assert.IsNotNull( contacts[i].PhysicalAddresses, "The PhysicalAddresses element in returned contact item should not be null."); Site.Assert.AreEqual<int>( 1, contacts[i].PhysicalAddresses.GetLength(0), "One entry of PhysicalAddresses element should be returned!"); #endregion } #region Capture Code this.Site.Assert.IsTrue( this.IsSchemaValidated, "The schema should be validated! Expected result: {0}, Actual result: {1}", true.ToString(), this.IsSchemaValidated.ToString()); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R187"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R187 Site.CaptureRequirementIfAreEqual<PhysicalAddressKeyType>( PhysicalAddressKeyType.Business, contacts[0].PhysicalAddresses[0].Key, 187, @"[In t:PhysicalAddressKeyType Simple Type] Business: Identifies the address as a business address."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R188"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R188 Site.CaptureRequirementIfAreEqual<PhysicalAddressKeyType>( PhysicalAddressKeyType.Home, contacts[1].PhysicalAddresses[0].Key, 188, @"[In t:PhysicalAddressKeyType Simple Type] Home: Identifies the address as a home address."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R189"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R189 Site.CaptureRequirementIfAreEqual<PhysicalAddressKeyType>( PhysicalAddressKeyType.Other, contacts[2].PhysicalAddresses[0].Key, 189, @"[In t:PhysicalAddressKeyType Simple Type] Other: Identifies the address as an address of type other."); #endregion }
/// <summary> /// Build a contact item with enumeration value of PhysicalAddressKeyType. /// </summary> /// <param name="physicalAddressKeyType">The enumeration value of PhysicalAddressKeyType.</param> /// <returns>The contact item object.</returns> protected ContactItemType BuildContactItemWithPhysicalAddress(PhysicalAddressKeyType physicalAddressKeyType) { // Create a contact item type. ContactItemType item = new ContactItemType() { // Set a single contact physical address. PhysicalAddresses = new PhysicalAddressDictionaryEntryType[] { new PhysicalAddressDictionaryEntryType() { City = Common.GenerateResourceName( this.Site, "City"), Key = physicalAddressKeyType, } } }; return item; }
/// <summary> /// Capture child element of ContactItemType Complex Type related requirements. /// </summary> /// <param name="responseContactItem">A contact item from the response package of GetItem operation.</param> /// <param name="requestContactItem">A contact item from the request package of CreateItem operation.</param> protected void VerifyChildElementInContactItemTypeComplexType(ContactItemType responseContactItem, ContactItemType requestContactItem) { Site.Assert.IsNotNull(responseContactItem, "The contact item should not be null!"); Site.Assert.IsTrue(this.IsSchemaValidated, "The schema validation result should be true."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R20"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R20 Site.CaptureRequirementIfIsNotNull( responseContactItem.FileAs, 20, @"[In t:ContactItemType Complex Type] The type of the element of FileAs is xs:string [XMLSCHEMA2]"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R24"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R24 Site.CaptureRequirementIfIsNotNull( responseContactItem.DisplayName, 24, @"[In t:ContactItemType Complex Type] The type of the element of DisplayName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R25"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R25 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.DisplayName, responseContactItem.DisplayName, 25, @"[In t:ContactItemType Complex Type] DisplayName element: Contains the display name of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R26"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R26 Site.CaptureRequirementIfIsNotNull( responseContactItem.GivenName, 26, @"[In t:ContactItemType Complex Type] The type of the element of GivenName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R27"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R27 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.GivenName, responseContactItem.GivenName, 27, @"[In t:ContactItemType Complex Type] GivenName element: Contains the given name for a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R28"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R28 Site.CaptureRequirementIfIsNotNull( responseContactItem.Initials, 28, @"[In t:ContactItemType Complex Type] The type of the element of Initials is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R29"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R29 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Initials, responseContactItem.Initials, 29, @"[In t:ContactItemType Complex Type] Initials element: Contains the initials for a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R30"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R30 Site.CaptureRequirementIfIsNotNull( responseContactItem.MiddleName, 30, @"[In t:ContactItemType Complex Type] The type of the element of MiddleName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R31"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R31 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.MiddleName, responseContactItem.MiddleName, 31, @"[In t:ContactItemType Complex Type] MiddleName element: Represents the middle name of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R32"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R32 Site.CaptureRequirementIfIsNotNull( responseContactItem.Nickname, 32, @"[In t:ContactItemType Complex Type] The type of the element of Nickname is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R33"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R33 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Nickname, responseContactItem.Nickname, 33, @"[In t:ContactItemType Complex Type] Nickname element: Represents the nickname of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R36"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R36 Site.CaptureRequirementIfIsNotNull( responseContactItem.CompanyName, 36, @"[In t:ContactItemType Complex Type] The type of the element of CompanyName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R37"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R37 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.CompanyName, responseContactItem.CompanyName, 37, @"[In t:ContactItemType Complex Type] CompanyName element: Contains the company name that is associated with a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R44"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R44 Site.CaptureRequirementIfIsNotNull( responseContactItem.AssistantName, 44, @"[In t:ContactItemType Complex Type] The type of the element of AssistantName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R45"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R45 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.AssistantName, responseContactItem.AssistantName, 45, @"[In t:ContactItemType Complex Type] AssistantName element: Contains the name of the assistant for the contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R46"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R46 Site.CaptureRequirementIfIsTrue( responseContactItem.BirthdaySpecified, 46, @"[In t:ContactItemType Complex Type] The type of the element of Birthday is xs:dateTime [XMLSCHEMA2]."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R47"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R47 this.Site.CaptureRequirementIfAreEqual<DateTime>( requestContactItem.Birthday, responseContactItem.Birthday, 47, @"[In t:ContactItemType Complex Type] Birthday element: Represents the birthday of the contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R56"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R56 Site.CaptureRequirementIfIsNotNull( responseContactItem.Department, 56, @"[In t:ContactItemType Complex Type] The type of the element of Department is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R57"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R57 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Department, responseContactItem.Department, 57, @"[In t:ContactItemType Complex Type] Department element: Contains the work department for the contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R58"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R58 Site.CaptureRequirementIfIsNotNull( responseContactItem.Generation, 58, @"[In t:ContactItemType Complex Type] The type of the element of Generation is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R59"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R59 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Generation, responseContactItem.Generation, 59, @"[In t:ContactItemType Complex Type] Generation element: Contains a generational abbreviation that follows the full name of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R62"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R62 Site.CaptureRequirementIfIsNotNull( responseContactItem.JobTitle, 62, @"[In t:ContactItemType Complex Type] The type of the element of JobTitle is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R63"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R63 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.JobTitle, responseContactItem.JobTitle, 63, @"[In t:ContactItemType Complex Type] JobTitle element: Contains the job title of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R64"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R64 Site.CaptureRequirementIfIsNotNull( responseContactItem.Manager, 64, @"[In t:ContactItemType Complex Type] The type of the element of Manager is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R65"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R65 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Manager, responseContactItem.Manager, 65, @"[In t:ContactItemType Complex Type] Manager element: Represents the manager of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R66"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R66 Site.CaptureRequirementIfIsNotNull( responseContactItem.Mileage, 66, @"[In t:ContactItemType Complex Type] The type of the element of Mileage is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R67"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R67 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Mileage, responseContactItem.Mileage, 67, @"[In t:ContactItemType Complex Type] Mileage element: Represents the mileage for a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R68"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R68 Site.CaptureRequirementIfIsNotNull( responseContactItem.OfficeLocation, 68, @"[In t:ContactItemType Complex Type] The type of the element of OfficeLocation is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R69"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R69 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.OfficeLocation, responseContactItem.OfficeLocation, 69, @"[In t:ContactItemType Complex Type] OfficeLocation element: Represents the office location of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R72"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R72 Site.CaptureRequirementIfIsNotNull( responseContactItem.Profession, 72, @"[In t:ContactItemType Complex Type] The type of the element of Profession is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R73"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R73 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Profession, responseContactItem.Profession, 73, @"[In t:ContactItemType Complex Type] Profession element: Represents the profession of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R74"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R74 Site.CaptureRequirementIfIsNotNull( responseContactItem.SpouseName, 74, @"[In t:ContactItemType Complex Type] The type of the element of SpouseName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R75"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R75 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.SpouseName, responseContactItem.SpouseName, 75, @"[In t:ContactItemType Complex Type] SpouseName element: Represents the name of the spouse/partner of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R76"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R76 Site.CaptureRequirementIfIsNotNull( responseContactItem.Surname, 76, @"[In t:ContactItemType Complex Type] The type of the element of Surname is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R77"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R77 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Surname, responseContactItem.Surname, 77, @"[In t:ContactItemType Complex Type] Surname element: Contains the surname of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R78"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R78 Site.CaptureRequirementIfIsTrue( responseContactItem.WeddingAnniversarySpecified, 78, @"[In t:ContactItemType Complex Type] The type of the element of WeddingAnniversary is xs:dateTime"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R79"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R79 this.Site.CaptureRequirementIfAreEqual<DateTime>( requestContactItem.WeddingAnniversary, responseContactItem.WeddingAnniversary, 79, @"[In t:ContactItemType Complex Type] WeddingAnniversary element: Contains the wedding anniversary date of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R22"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R22 Site.CaptureRequirementIfIsTrue( responseContactItem.FileAsMappingSpecified, 22, @"[In t:ContactItemType Complex Type] The type of the element of FileAsMapping is t:FileAsMappingType (section 3.1.4.1.2.4)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R34"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R34 Site.CaptureRequirementIfIsNotNull( responseContactItem.CompleteName, 34, @"[In t:ContactItemType Complex Type] The type of the element of CompleteName is t:CompleteNameType (section 3.1.4.1.1.5)"); // Verify the CompleteNameType element of ContactItemType Complex Type. this.VerifyCompleteNameTypeComplexType(responseContactItem, requestContactItem); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R38"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R38 Site.CaptureRequirementIfIsNotNull( responseContactItem.EmailAddresses, 38, @"[In t:ContactItemType Complex Type] The type of the element of EmailAddresses is t:EmailAddressDictionaryType (section3.1.4.1.1.11)"); // Verify the EmailAddressDictionaryType element of ContactItemType Complex Type. this.VerifyEmailAddressDictionaryTypeComplexType(responseContactItem.EmailAddresses, requestContactItem.EmailAddresses); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R40"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R40 Site.CaptureRequirementIfIsNotNull( responseContactItem.PhysicalAddresses, 40, @"[In t:ContactItemType Complex Type] The type of the element of PhysicalAddresses is t:PhysicalAddressDictionaryType (section 3.1.4.1.1.17)."); this.VerifylPhysicalAddressDictionaryTypeComplexType(responseContactItem.PhysicalAddresses, requestContactItem.PhysicalAddresses); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R42"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R42 Site.CaptureRequirementIfIsNotNull( responseContactItem.PhoneNumbers, 42, @"[In t:ContactItemType Complex Type] The type of the element of PhoneNumbers is t:PhoneNumberDictionaryType (section 3.1.4.1.1.15)."); // Verify the PhoneNumberDictionaryType element of ContactItemType Complex Type. this.VerifyPhoneNumberDictionaryTypeComplexType(responseContactItem.PhoneNumbers, requestContactItem.PhoneNumbers); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R48"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R48 Site.CaptureRequirementIfIsNotNull( responseContactItem.BusinessHomePage, 48, @"[In t:ContactItemType Complex Type] The type of the element of BusinessHomePage is xs:anyURI [XMLSCHEMA2]."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R49"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R49 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.BusinessHomePage, responseContactItem.BusinessHomePage, 49, @"[In t:ContactItemType Complex Type] BusinessHomePage element: Contains the business home page Uniform Resource Identifier (URI) of a contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R60"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R60 Site.CaptureRequirementIfIsNotNull( responseContactItem.ImAddresses, 60, @"[In t:ContactItemType Complex Type] The type of the element of ImAddresses is t:ImAddressDictionaryType (section 3.1.4.1.1.13)."); // Verify the ImAddressDictionaryType element of ContactItemType Complex Type. this.VerifyImAddressDictionaryTypeComplexType(responseContactItem.ImAddresses, requestContactItem.ImAddresses); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R70"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R70 Site.CaptureRequirementIfIsTrue( responseContactItem.PostalAddressIndexSpecified, 70, @"[In t:ContactItemType Complex Type] The type of the element of PostalAddressIndex is t:PhysicalAddressIndexType (section 3.1.4.1.2.7)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R71"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R71 this.Site.CaptureRequirementIfAreEqual<PhysicalAddressIndexType>( requestContactItem.PostalAddressIndex, responseContactItem.PostalAddressIndex, 71, @"[In t:ContactItemType Complex Type] PostalAddressIndex element: Represents the index of one of the physical addresses, which is a contact's (2) mailing address."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R177"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R177 // Because R177 is captured based on R70 and R61, so if both of them are captured successfully, R177 can be captured. this.Site.CaptureRequirement( 177, @"[t:PhysicalAddressIndexType Simple Type] The PhysicalAddressIndexType simple type identifies the display types for physical addresses."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R50"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R50 Site.CaptureRequirementIfIsNotNull( responseContactItem.Children, 50, @"[In t:ContactItemType Complex Type] The type of the element of Children is t:ArrayOfStringsType ([MS-OXWSCDATA] section 2.2.4.13)."); Site.Assert.AreEqual<int>( 1, responseContactItem.Children.Length, string.Format( "The children of the item from response should be 1, actual: '{0}'.", responseContactItem.Children.Length)); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R51"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R51 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Children[0], responseContactItem.Children[0], 51, @"[In t:ContactItemType Complex Type] Children element: Contains the names of children for the contact (2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R52"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R52 Site.CaptureRequirementIfIsNotNull( responseContactItem.Companies, 52, @"[In t:ContactItemType Complex Type] The type of the element of Companies is t:ArrayOfStringsType."); Site.Assert.AreEqual<int>( 1, responseContactItem.Companies.Length, string.Format( "The companies of the item from response should be 1, actual: '{0}'.", responseContactItem.Companies.Length)); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R53"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R53 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Companies[0], responseContactItem.Companies[0], 53, @"[In t:ContactItemType Complex Type] Companies element: Contains the names of companies that are associated with a contact (2)."); }
/// <summary> /// Create a contact item with all properties. /// </summary> /// <returns>The contact item object.</returns> protected ContactItemType CreateFullPropertiesContact() { // Create a contact item type. ContactItemType item = new ContactItemType() { // Set the relevant properties on the contact. FileAs = Common.GenerateResourceName( this.Site, "FirstContact"), FileAsMapping = FileAsMappingType.None, FileAsMappingSpecified = true, // Set a single e-mail address for the contact. EmailAddresses = new EmailAddressDictionaryEntryType[] { new EmailAddressDictionaryEntryType() { Value = Common.GenerateResourceName(this.Site, "EmailAddress") + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site), Key = EmailAddressKeyType.EmailAddress1, } }, // Set the information of company for the contact. Companies = new string[] { Common.GenerateResourceName( this.Site, "Company") }, CompanyName = Common.GenerateResourceName( this.Site, "Company"), // Set the information of complete name for the contact. DisplayName = Common.GenerateResourceName( this.Site, "DisplayName"), Nickname = Common.GenerateResourceName( this.Site, "NickName"), GivenName = Common.GenerateResourceName( this.Site, "GivenName"), MiddleName = Common.GenerateResourceName( this.Site, "MiddleName"), Surname = Common.GenerateResourceName( this.Site, "SurName"), Initials = Common.GenerateResourceName( this.Site, "CI"), Generation = Common.GenerateResourceName( this.Site, "SR."), ExtendedProperty = new ExtendedPropertyType[] { // Set the title of the complete name. new ExtendedPropertyType() { ExtendedFieldURI = new PathToExtendedFieldType() { PropertyType = MapiPropertyTypeType.String, // The property tag. The PropertyTag attribute can be represented as either a hexadecimal value or a short integer. // The hexadecimal value range: 0x8000< hexadecimal value <0xFFFE, it represents the custom range of properties. // If the PropertyTag attribute is used, the DistinguishedPropertySetId, PropertySetId, PropertyName, and PropertyId attributes must not be used. PropertyTag = "0x3a45", }, Item = Common.GenerateResourceName( this.Site, "MR."), }, // Set the YomiFirstName of the complete name. new ExtendedPropertyType() { ExtendedFieldURI = new PathToExtendedFieldType() { PropertyType = MapiPropertyTypeType.String, DistinguishedPropertySetId = DistinguishedPropertySetType.Address, // The GUID of the PSETID_Address. The value must be 00062004-0000-0000-C000-000000000046. // The detail refer to:http://go.microsoft.com/fwlink/?LinkId=517862 PropertySetId = "00062004-0000-0000-C000-000000000046", // The dispatch ID. The value must be 0x0000802C. The detail refer to:http://go.microsoft.com/fwlink/?LinkId=517863 PropertyId = Convert.ToInt32("0x0000802C", 16), PropertyIdSpecified = true, }, Item = Common.GenerateResourceName( this.Site, "YomiFirstName"), }, // Set the YomiLastName of the complete name. new ExtendedPropertyType() { ExtendedFieldURI = new PathToExtendedFieldType() { PropertyType = MapiPropertyTypeType.String, DistinguishedPropertySetId = DistinguishedPropertySetType.Address, // The GUID of the PSETID_Address. The value must be 00062004-0000-0000-C000-000000000046. // The detail refer to:http://go.microsoft.com/fwlink/?LinkId=517862 PropertySetId = "00062004-0000-0000-C000-000000000046", // The dispatch ID. The value must be 0x0000802D. The detail refer to:http://go.microsoft.com/fwlink/?LinkId=517863 PropertyId = Convert.ToInt32("0x0000802D", 16), PropertyIdSpecified = true, }, Item = Common.GenerateResourceName( this.Site, "YomiLastName"), }, }, // Set the instant messaging addresses for a contact. ImAddresses = new ImAddressDictionaryEntryType[] { new ImAddressDictionaryEntryType() { Key = new ImAddressKeyType(), Value = Common.GenerateResourceName( this.Site, "DetailAddress"), }, }, // Set the contact telephone number. PhoneNumbers = new PhoneNumberDictionaryEntryType[] { new PhoneNumberDictionaryEntryType() { Key = PhoneNumberKeyType.BusinessPhone, Value = "123456789", } }, // Set a single contact physical address. PhysicalAddresses = new PhysicalAddressDictionaryEntryType[] { new PhysicalAddressDictionaryEntryType() { City = Common.GenerateResourceName( this.Site, "City"), CountryOrRegion = Common.GenerateResourceName( this.Site, "CountryOrRegion"), PostalCode = "123456", State = Common.GenerateResourceName( this.Site, "State"), Street = Common.GenerateResourceName( this.Site, "Street"), Key = PhysicalAddressKeyType.Business, } }, // Set other relevant properties on the contact. SpouseName = Common.GenerateResourceName( this.Site, "SpouseName"), AssistantName = Common.GenerateResourceName( this.Site, "AssistantName"), Birthday = Convert.ToDateTime("1988-10-16"), BirthdaySpecified = true, BusinessHomePage = "http://www.microsoft.com", JobTitle = Common.GenerateResourceName( this.Site, "JobTitle"), Manager = Common.GenerateResourceName( this.Site, "Manager"), Mileage = Common.GenerateResourceName( this.Site, "Mileage"), OfficeLocation = Common.GenerateResourceName( this.Site, "OfficeLocation"), Subject = Common.GenerateResourceName( this.Site, "Subject"), Categories = new string[] { Common.GenerateResourceName( this.Site, "Categories") }, HasAttachments = false, HasAttachmentsSpecified = false, HasPicture = false, HasPictureSpecified = false, Culture = "en-US", Department = Common.GenerateResourceName( this.Site, "Department"), ContactSource = ContactSourceType.ActiveDirectory, ContactSourceSpecified = true, Importance = ImportanceChoicesType.Normal, ImportanceSpecified = true, Profession = Common.GenerateResourceName( this.Site, "Profession"), Sensitivity = SensitivityChoicesType.Normal, SensitivitySpecified = true, Children = new string[] { Common.GenerateResourceName( this.Site, "Children") }, PostalAddressIndex = PhysicalAddressIndexType.Business, PostalAddressIndexSpecified = true, WeddingAnniversary = Convert.ToDateTime("2010-10-10"), WeddingAnniversarySpecified = true }; return item; }
/// <summary> /// Build a contact item with enumeration value of EmailAddressKeyType. /// </summary> /// <param name="emailAddressKeyType">The enumeration value of EmailAddressKeyType.</param> /// <returns>The contact item object.</returns> protected ContactItemType BuildContactItemWithEmailAddress(EmailAddressKeyType emailAddressKeyType) { // Create a contact item type. ContactItemType item = new ContactItemType() { // Set a single e-mail address for the contact. EmailAddresses = new EmailAddressDictionaryEntryType[] { new EmailAddressDictionaryEntryType() { Value = Common.GenerateResourceName(this.Site, "EmailAddress") + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site), Key = emailAddressKeyType, } } }; return item; }
public void MSOXWSCORE_S02_TC11_GetContactItemWithConvertHtmlCodePageToUTF8() { Site.Assume.IsTrue(Common.IsRequirementEnabled(21498, this.Site), "Exchange 2007 and Exchange 2010 do not include the ConvertHtmlCodePageToUTF8 element."); ContactItemType item = new ContactItemType(); this.TestSteps_VerifyGetItemWithItemResponseShapeType_ConvertHtmlCodePageToUTF8Boolean(item); }
public void MSOXWSCORE_S02_TC12_GetContactItemWithAddBlankTargetToLinks() { Site.Assume.IsTrue(Common.IsRequirementEnabled(2149908, this.Site), "Exchange 2007 and Exchange 2010 do not use the AddBlankTargetToLinks element."); ContactItemType item = new ContactItemType(); this.TestSteps_VerifyGetItemWithItemResponseShapeType_AddBlankTargetToLinksBoolean(item); }
public void MSOXWSCORE_S02_TC08_VerifyExtendPropertyType() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyDistinguishedPropertySetIdConflictsWithPropertySetId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyDistinguishedPropertySetIdConflictsWithPropertyTag(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyDistinguishedPropertySetIdWithPropertyTypeOrPropertyName(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertySetIdConflictsWithDistinguishedPropertySetId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertySetIdConflictsWithPropertyTag(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertySetIdWithPropertyTypeOrPropertyName(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyTagRepresentation(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyTagConflictsWithDistinguishedPropertySetId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyTagConflictsWithPropertySetId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyTagConflictsWithPropertyName(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyTagConflictsWithPropertyId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyNameWithDistinguishedPropertySetIdOrPropertySetId(DistinguishedFolderIdNameType.contacts, item); this.TestSteps_VerifyPropertyIdWithDistinguishedPropertySetIdOrPropertySetId(DistinguishedFolderIdNameType.contacts, item); }
public void MSOXWSCORE_S02_TC09_OperateMultipleContactItemsSuccessfully() { ContactItemType[] items = new ContactItemType[] { new ContactItemType(), new ContactItemType() }; this.TestSteps_VerifyOperateMultipleItems(items); }
public void MSOXWSCORE_S02_TC07_CreateContactItemFailed() { #region Step 1: Create the contact item with invalid item class. ContactItemType[] createdItems = new ContactItemType[] { new ContactItemType() { Subject = Common.GenerateResourceName( this.Site, TestSuiteHelper.SubjectForCreateItem), // Set an invalid ItemClass to contact item. ItemClass = TestSuiteHelper.InvalidItemClass } }; CreateItemResponseType createItemResponse = this.CallCreateItemOperation(DistinguishedFolderIdNameType.contacts, createdItems); #endregion // Get ResponseCode from CreateItem operation response. ResponseCodeType responseCode = createItemResponse.ResponseMessages.Items[0].ResponseCode; // Verify MS-OXWSCDATA_R619. this.VerifyErrorObjectTypeChanged(responseCode); }
public void MSOXWSCORE_S02_TC06_UpdateContactItemFailed() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyUpdateItemFailedResponse(item); }
public void MSOXWSCORE_S02_TC05_MarkAllContactItemsAsReadSuccessfully() { Site.Assume.IsTrue(Common.IsRequirementEnabled(1290, this.Site), "Exchange 2007 and Exchange 2010 do not support the MarkAllItemsAsRead operation."); ContactItemType[] items = new ContactItemType[] { new ContactItemType(), new ContactItemType() }; this.TestSteps_VerifyMarkAllItemsAsRead<ContactItemType>(items); }
/// <summary> /// Call CreateItem operation. /// </summary> /// <param name="contactItem">The contact item to be created.</param> /// <returns>The CreateItem response.</returns> protected CreateItemResponseType CallCreateItemOperation(ContactItemType contactItem) { CreateItemType createItemRequest = new CreateItemType(); #region Config the contact item createItemRequest.Items = new NonEmptyArrayOfAllItemsType(); createItemRequest.Items.Items = new ContactItemType[1]; // Create a contact item without optional elements. createItemRequest.Items.Items[0] = contactItem; // Configure the SavedItemFolderId of CreateItem request to specify that the created item is saved under which folder. createItemRequest.SavedItemFolderId = new TargetFolderIdType() { Item = new DistinguishedFolderIdType() { Id = DistinguishedFolderIdNameType.contacts, } }; #endregion // Call CreateItem operation. CreateItemResponseType createItemResponse = this.CONTAdapter.CreateItem(createItemRequest); return createItemResponse; }
public void MSOXWSCORE_S02_TC13_GetContactItemWithBlockExternalImages() { Site.Assume.IsTrue(Common.IsRequirementEnabled(2149905, this.Site), "Exchange 2007 and Exchange 2010 do not use the BlockExternalImages element."); ContactItemType item = new ContactItemType(); this.TestSteps_VerifyGetItemWithItemResponseShapeType_BlockExternalImagesBoolean(item); }
/// <summary> /// Capture CompleteNameType Complex Type related requirements. /// </summary> /// <param name="responseContactItem">The ContactItemType element from the response package of GetItem operation.</param> /// <param name="requestContactItem">The ContactItemType element from the request package of CreateItem operation.</param> private void VerifyCompleteNameTypeComplexType(ContactItemType responseContactItem, ContactItemType requestContactItem) { Site.Assert.IsNotNull(responseContactItem.CompleteName, "The complete name element should not be null!"); Site.Assert.IsNotNull(responseContactItem.CompleteName.Title, "The Title of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R193"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R193 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 193, @"[In t:CompleteNameType Complex Type] The type of the element of Title is xs:string [XMLSCHEMA2]"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R194"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R194 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.ExtendedProperty[0].Item as string, responseContactItem.CompleteName.Title, 194, @"[In t:CompleteNameType Complex Type] Title element: Contains the title of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.FirstName, "The FirstName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R195"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R195 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 195, @"[In t:CompleteNameType Complex Type] The type of the element of FirstName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R355"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R355 this.Site.CaptureRequirementIfAreEqual<string>( responseContactItem.GivenName, responseContactItem.CompleteName.FirstName, 355, @"[In t:CompleteNameType Complex Type] This [FirstName element] is the same as GivenName."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R196"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R196 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.GivenName, responseContactItem.CompleteName.FirstName, 196, @"[In t:CompleteNameType Complex Type] FirstName element: Contains the first name of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.MiddleName, "The MiddleName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R197"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R197 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 197, @"[In t:CompleteNameType Complex Type] The type of the element of MiddleName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R198"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R198 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.MiddleName, responseContactItem.CompleteName.MiddleName, 198, @"[In t:CompleteNameType Complex Type] MiddleName element: Contains the middle name of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.LastName, "The LastName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R199"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R199 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 199, @"[In t:CompleteNameType Complex Type] The type of the element of LastName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R356"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R356 this.Site.CaptureRequirementIfAreEqual<string>( responseContactItem.Surname, responseContactItem.CompleteName.LastName, 356, @"[In t:CompleteNameType Complex Type] This [LastName element] is the same as the Surname."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R200"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R200 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Surname, responseContactItem.CompleteName.LastName, 200, @"[In t:CompleteNameType Complex Type] LastName element: Contains the last name of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.Suffix, "The Suffix of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R201"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R201 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 201, @"[In t:CompleteNameType Complex Type] The type of the element of Suffix is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R357"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R357 this.Site.CaptureRequirementIfAreEqual<string>( responseContactItem.Generation, responseContactItem.CompleteName.Suffix, 357, @"[In t:CompleteNameType Complex Type] This [Suffix element] is the same as the Generation property."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R202"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R202 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Generation, responseContactItem.CompleteName.Suffix, 202, @"[In t:CompleteNameType Complex Type] Suffix element: Contains a suffix to a contact's (2) name."); Site.Assert.IsNotNull(responseContactItem.CompleteName.Initials, "The Initials of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R203"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R203 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 203, @"[In t:CompleteNameType Complex Type] The type of the element of Initials is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R204"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R204 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Initials, responseContactItem.CompleteName.Initials, 204, @"[In t:CompleteNameType Complex Type] Initials element: Contains the initials of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.FullName, "The FullName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R205"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R205 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 205, @"[In t:CompleteNameType Complex Type] The type of the element of FullName is xs:string"); Site.Assert.IsNotNull(responseContactItem.CompleteName.Nickname, "The Nickname of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R207"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R207 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 207, @"[In t:CompleteNameType Complex Type] The type of the element of Nickname is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R208"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R208 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.Nickname, responseContactItem.CompleteName.Nickname, 208, @"[In t:CompleteNameType Complex Type] Nickname element: Contains the nickname of a contact (2)."); Site.Assert.IsNotNull(responseContactItem.CompleteName.YomiFirstName, "The YomiFirstName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R209"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R209 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 209, @"[In t:CompleteNameType Complex Type] The type of the element of YomiFirstName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R210"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R210 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.ExtendedProperty[1].Item as string, responseContactItem.CompleteName.YomiFirstName, 210, @"[In t:CompleteNameType Complex Type] YomiFirstName element: Contains the name used in Japan for the searchable or phonetic spelling of a Japanese first name."); Site.Assert.IsNotNull(responseContactItem.CompleteName.YomiLastName, "The YomiLastName of CompleteName from response contact item should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R211"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R211 Site.CaptureRequirementIfIsTrue( this.IsSchemaValidated, 211, @"[In t:CompleteNameType Complex Type] The type of the element of YomiLastName is xs:string"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R212"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R212 this.Site.CaptureRequirementIfAreEqual<string>( requestContactItem.ExtendedProperty[2].Item as string, responseContactItem.CompleteName.YomiLastName, 212, @"[In t:CompleteNameType Complex Type] YomiLastName element: Contains the name used in Japan for the searchable or phonetic spelling of a Japanese last name."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R35"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R35 // Because R35 is captured based on R194, R196, R198, R200, R202, R204, R208, R210 and R212, so if all of them are captured successfully, R35 can be captured. this.Site.CaptureRequirement( 35, @"[In t:ContactItemType Complex Type] CompleteName element: Represents the complete name of a contact (2)."); }
public void MSOXWSCORE_S02_TC14_GetContactItemWithDefaultShapeNamesTypeEnum() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyGetItemWithItemResponseShapeType_DefaultShapeNamesTypeEnum(item); }
/// <summary> /// Create a contact item with enumeration value of FileAsMappingType. /// </summary> /// <param name="fileAsMappingType">The enumeration value of FileAsMappingType.</param> /// <returns>The contact item object.</returns> 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; }
public void MSOXWSCORE_S02_TC15_GetContactItemWithBodyTypeResponseTypeEnum() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyGetItemWithItemResponseShapeType_BodyTypeResponseTypeEnum(item); }
/// <summary> /// Build a contact item with enumeration value of ImAddressKeyType. /// </summary> /// <param name="instantMessagingAddress">The enumeration value of ImAddressKeyType.</param> /// <returns>The contact item object.</returns> protected ContactItemType BuildContactItemWithImAddress(ImAddressKeyType instantMessagingAddress) { // Create a contact item type. ContactItemType item = new ContactItemType() { // Set a single IM address for the contact. ImAddresses = new ImAddressDictionaryEntryType[] { new ImAddressDictionaryEntryType() { Value = Common.GenerateResourceName(this.Site, "EmailAddress") + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site), Key = instantMessagingAddress, } } }; return item; }
public void MSOXWSCORE_S02_TC16_CreateContactItemWithInvalidItemClass() { #region Step 1: Create the contact item with ItemClass set to IPM.Appointment. CreateItemType createItemRequest = new CreateItemType(); createItemRequest.Items = new NonEmptyArrayOfAllItemsType(); ContactItemType item = new ContactItemType(); createItemRequest.Items.Items = new ItemType[] { item }; createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem, 1); createItemRequest.Items.Items[0].ItemClass = "IPM.Appointment"; CreateItemResponseType createItemResponse = this.COREAdapter.CreateItem(createItemRequest); Site.Assert.AreEqual<ResponseCodeType>( ResponseCodeType.ErrorObjectTypeChanged, createItemResponse.ResponseMessages.Items[0].ResponseCode, "ErrorObjectTypeChanged should be returned if create a contact item with ItemClass IPM.Appointment."); #endregion #region Step 2: Create the contact item with ItemClass set to IPM.Post. createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem, 2); createItemRequest.Items.Items[0].ItemClass = "IPM.Post"; createItemResponse = this.COREAdapter.CreateItem(createItemRequest); Site.Assert.AreEqual<ResponseCodeType>( ResponseCodeType.ErrorObjectTypeChanged, createItemResponse.ResponseMessages.Items[0].ResponseCode, "ErrorObjectTypeChanged should be returned if create a contact item with ItemClass IPM.Post."); #endregion #region Step 3: Create the contact item with ItemClass set to IPM.Task. createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem, 3); createItemRequest.Items.Items[0].ItemClass = "IPM.Task"; createItemResponse = this.COREAdapter.CreateItem(createItemRequest); Site.Assert.AreEqual<ResponseCodeType>( ResponseCodeType.ErrorObjectTypeChanged, createItemResponse.ResponseMessages.Items[0].ResponseCode, "ErrorObjectTypeChanged should be returned if create a contact item with ItemClass IPM.Task."); #endregion #region Step 4: Create the contact item with ItemClass set to IPM.DistList. createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem, 4); createItemRequest.Items.Items[0].ItemClass = "IPM.DistList"; createItemResponse = this.COREAdapter.CreateItem(createItemRequest); Site.Assert.AreEqual<ResponseCodeType>( ResponseCodeType.ErrorObjectTypeChanged, createItemResponse.ResponseMessages.Items[0].ResponseCode, "ErrorObjectTypeChanged should be returned if create a contact item with ItemClass IPM.DistList."); #endregion #region Step 5: Create the contact item with ItemClass set to random string. createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem, 5); createItemRequest.Items.Items[0].ItemClass = Common.GenerateResourceName(this.Site, "ItemClass"); createItemResponse = this.COREAdapter.CreateItem(createItemRequest); Site.Assert.AreEqual<ResponseCodeType>( ResponseCodeType.ErrorObjectTypeChanged, createItemResponse.ResponseMessages.Items[0].ResponseCode, "ErrorObjectTypeChanged should be returned if create a contact item with ItemClass is set to a random string."); #endregion // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2023"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2023 this.Site.CaptureRequirement( 2023, @"[In t:ItemType Complex Type] If invalid values are set for these items in the CreateItem request, an ErrorObjectTypeChanged ([MS-OXWSCDATA] section 2.2.5.24) response code will be returned in the CreateItem response."); }
/// <summary> /// Build a contact item with only required elements. /// </summary> /// <returns>The contact item object.</returns> protected ContactItemType BuildContactItemWithRequiredProperties() { // Create a contact item type. ContactItemType item = new ContactItemType(); item.FileAs = Common.GenerateResourceName( this.Site, "FirstContact"); return item; }
public void MSOXWSCORE_S02_TC01_CreateGetDeleteContactItemSuccessfully() { ContactItemType item = new ContactItemType(); this.TestSteps_VerifyCreateGetDeleteItem(item); }
public void MSOXWSCONT_S01_TC04_VerifyContactItemWithFileAsMappingTypeEnums() { // The value count of enumeration "FileAsMappingType" is 13. int enumCount = 13; FileAsMappingType[] fileAsMappingTypes = new FileAsMappingType[enumCount]; ContactItemType[] requestItems = new ContactItemType[enumCount]; fileAsMappingTypes[0] = FileAsMappingType.None; fileAsMappingTypes[1] = FileAsMappingType.LastCommaFirst; fileAsMappingTypes[2] = FileAsMappingType.FirstSpaceLast; fileAsMappingTypes[3] = FileAsMappingType.Company; fileAsMappingTypes[4] = FileAsMappingType.LastCommaFirstCompany; fileAsMappingTypes[5] = FileAsMappingType.CompanyLastFirst; fileAsMappingTypes[6] = FileAsMappingType.LastFirst; fileAsMappingTypes[7] = FileAsMappingType.LastFirstCompany; fileAsMappingTypes[8] = FileAsMappingType.CompanyLastCommaFirst; fileAsMappingTypes[9] = FileAsMappingType.LastFirstSuffix; fileAsMappingTypes[10] = FileAsMappingType.LastSpaceFirstCompany; fileAsMappingTypes[11] = FileAsMappingType.CompanyLastSpaceFirst; fileAsMappingTypes[12] = FileAsMappingType.LastSpaceFirst; // Define a contact array to store the contact items got from GetItem operation response. // Each contact should contain a FileAsMappingType value as its element's value. ContactItemType[] contacts = new ContactItemType[enumCount]; for (int i = 0; i < enumCount; i++) { FileAsMappingType fileAsMappingType = fileAsMappingTypes[i]; #region Step 1:Create the contact item with FileAsMappingType // Create a contact item with FileAsMappingType. requestItems[i] = this.CreateFileAsMappingTypeContact(fileAsMappingType); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(requestItems[i]); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Get the contact item. // The contact item to get. ItemIdType[] itemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemIds); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ContactItemType[] getItems = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One contact item should be returned!"); contacts[i] = getItems[0]; Site.Assert.IsNotNull( contacts[i], "The returned contact item should not be null."); Site.Assert.IsTrue( contacts[i].FileAsMappingSpecified, "The FileAsMapping element in returned contact item should be specified."); Site.Assert.IsNotNull( contacts[i].CompleteName, "The returned CompleteName element in contact item should not be null."); #endregion } #region Capture Code this.Site.Assert.IsTrue( this.IsSchemaValidated, "The schema should be validated! Expected result: {0}, Actual result: {1}", true.ToString(), this.IsSchemaValidated.ToString()); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R130, Expected result: FileAsMapping is {0}, FileAs is {1}. Actual result: FileAsMapping is {2}, FileAs is {3}", requestItems[0].FileAsMapping, requestItems[0].FileAs, contacts[0].FileAsMapping, contacts[0].FileAs); // If the FileAsMapping element of contacts[0] equals to None, // and the FileAs element in response equals that in request, which is not constructed by other properties, // then this requirement can be verified. bool isVerifyR130 = contacts[0].FileAsMapping == FileAsMappingType.None && contacts[0].FileAs == requestItems[0].FileAs; // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R130 Site.CaptureRequirementIfIsTrue( isVerifyR130, 130, @"[In t:FileAsMappingType Simple Type] None: Indicates that the FileAs value is not constructed from properties of other contacts (2), but is represented by a string, saved ""as is"". "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R133, Expected result: FileAsMapping is {0}, FileAs is {1}. Actual result: FileAsMapping is {2}, FileAs is {3}", requestItems[3].FileAsMapping, requestItems[3].CompanyName, contacts[3].FileAsMapping, contacts[3].FileAs); // If the FileAsMapping element of contacts[3] equals to Company, // and the FileAs element equals to the company name, // then this requirement can be verified. bool isVerifyR133 = contacts[3].FileAsMapping == FileAsMappingType.Company && contacts[3].FileAs == contacts[3].CompanyName; // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R133 Site.CaptureRequirementIfIsTrue( isVerifyR133, 133, @"[In t:FileAsMappingType Simple Type] Company: Indicates that the company name is displayed."); #endregion }
public void MSOXWSCORE_S02_TC02_CopyContactItemSuccessfully() { #region Step 1: Create the contact item. ContactItemType item = new ContactItemType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2:Copy the contact item // Call CopyItem operation. CopyItemResponseType copyItemResponse = this.CallCopyItemOperation(DistinguishedFolderIdNameType.drafts, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(copyItemResponse, 1, this.Site); ItemIdType[] copiedItemIds = Common.GetItemIdsFromInfoResponse(copyItemResponse); // One copied contact item should be returned. Site.Assert.AreEqual<int>( 1, copiedItemIds.GetLength(0), "One copied contact item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, copiedItemIds.GetLength(0)); #endregion #region Step 3: Get the first created contact item success. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One contact item should be returned. Site.Assert.AreEqual<int>( 1, getItemIds.GetLength(0), "One contact item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2018"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2018 this.Site.CaptureRequirementIfAreEqual<string>( "IPM.Contact", ((ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]).Items.Items[0].ItemClass, 2018, @"[In t:ItemType Complex Type] This value is ""IPM.Contact"" for contact item."); #endregion #region Step 4: Get the second copied contact item success. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(copiedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One contact item should be returned. Site.Assert.AreEqual<int>( 1, getItemIds.GetLength(0), "One contact item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }
public void MSOXWSCONT_S01_TC06_VerifyContactItemWithPhoneNumbersKeyTypeEnums() { // The value count of enumeration "PhoneNumberKeyType" is 19. int enumCount = 19; PhoneNumberKeyType[] phoneNumberKeyTypes = new PhoneNumberKeyType[enumCount]; phoneNumberKeyTypes[0] = PhoneNumberKeyType.AssistantPhone; phoneNumberKeyTypes[1] = PhoneNumberKeyType.BusinessFax; phoneNumberKeyTypes[2] = PhoneNumberKeyType.BusinessPhone; phoneNumberKeyTypes[3] = PhoneNumberKeyType.BusinessPhone2; phoneNumberKeyTypes[4] = PhoneNumberKeyType.Callback; phoneNumberKeyTypes[5] = PhoneNumberKeyType.CarPhone; phoneNumberKeyTypes[6] = PhoneNumberKeyType.CompanyMainPhone; phoneNumberKeyTypes[7] = PhoneNumberKeyType.HomeFax; phoneNumberKeyTypes[8] = PhoneNumberKeyType.HomePhone; phoneNumberKeyTypes[9] = PhoneNumberKeyType.HomePhone2; phoneNumberKeyTypes[10] = PhoneNumberKeyType.Isdn; phoneNumberKeyTypes[11] = PhoneNumberKeyType.MobilePhone; phoneNumberKeyTypes[12] = PhoneNumberKeyType.OtherFax; phoneNumberKeyTypes[13] = PhoneNumberKeyType.OtherTelephone; phoneNumberKeyTypes[14] = PhoneNumberKeyType.Pager; phoneNumberKeyTypes[15] = PhoneNumberKeyType.PrimaryPhone; phoneNumberKeyTypes[16] = PhoneNumberKeyType.RadioPhone; phoneNumberKeyTypes[17] = PhoneNumberKeyType.Telex; phoneNumberKeyTypes[18] = PhoneNumberKeyType.TtyTddPhone; // Define a contact array to store the contact items got from GetItem operation response. // Each contact should contain a PhoneNumberKeyType value as its element's value. ContactItemType[] contacts = new ContactItemType[enumCount]; for (int i = 0; i < enumCount; i++) { PhoneNumberKeyType phoneNumberKeyType = phoneNumberKeyTypes[i]; // Create a contact item. ContactItemType item = new ContactItemType() { // Set a single phone number for the contact. PhoneNumbers = new PhoneNumberDictionaryEntryType[] { new PhoneNumberDictionaryEntryType() { Value = "123456789", Key = phoneNumberKeyType, } } }; #region Step 1:Create the contact item with PhoneNumberKeyType // Call CreateItem operation. CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Get the contact item // The contact item to get. ItemIdType[] itemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemIds); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ContactItemType[] getItems = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One contact item should be returned!"); contacts[i] = getItems[0]; Site.Assert.IsNotNull( contacts[i], "The returned contact item should not be null."); Site.Assert.IsNotNull( contacts[i].PhoneNumbers, "The PhoneNumbers element in returned contact item should not be null."); Site.Assert.AreEqual<int>( 1, contacts[i].PhoneNumbers.GetLength(0), "One entry of PhoneNumbers element should be returned!"); #endregion } #region Capture Code this.Site.Assert.IsTrue( this.IsSchemaValidated, "The schema should be validated! Expected result: {0}, Actual result: {1}", true.ToString(), this.IsSchemaValidated.ToString()); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R157"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R157 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.AssistantPhone, contacts[0].PhoneNumbers[0].Key, 157, @"[In t:PhoneNumberKeyType Simple Type] AssistantPhone: Identifies the telephone number as the assistant's telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R158"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R158 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.BusinessFax, contacts[1].PhoneNumbers[0].Key, 158, @"[In t:PhoneNumberKeyType Simple Type] BusinessFax: Identifies the telephone number as a business fax number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R159"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R159 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.BusinessPhone, contacts[2].PhoneNumbers[0].Key, 159, @"[In t:PhoneNumberKeyType Simple Type] BusinessPhone: Identifies the telephone number as a business telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R160"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R160 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.BusinessPhone2, contacts[3].PhoneNumbers[0].Key, 160, @"[In t:PhoneNumberKeyType Simple Type] BusinessPhone2: Identifies the telephone number as a second business telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R161"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R161 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.Callback, contacts[4].PhoneNumbers[0].Key, 161, @"[In t:PhoneNumberKeyType Simple Type] Callback: Identifies the telephone number as a callback number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R162"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R162 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.CarPhone, contacts[5].PhoneNumbers[0].Key, 162, @"[In t:PhoneNumberKeyType Simple Type] CarPhone: Identifies the telephone number as a car telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R163"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R163 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.CompanyMainPhone, contacts[6].PhoneNumbers[0].Key, 163, @"[In t:PhoneNumberKeyType Simple Type] CompanyMainPhone: Identifies the telephone number as the company's main telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R164"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R164 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.HomeFax, contacts[7].PhoneNumbers[0].Key, 164, @"[In t:PhoneNumberKeyType Simple Type] HomeFax: Identifies the telephone number as a home fax number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R165"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R165 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.HomePhone, contacts[8].PhoneNumbers[0].Key, 165, @"[In t:PhoneNumberKeyType Simple Type] HomePhone: Identifies the telephone number as a home telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R166"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R166 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.HomePhone2, contacts[9].PhoneNumbers[0].Key, 166, @"[In t:PhoneNumberKeyType Simple Type] HomePhone2: Identifies the telephone number as a second home telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R167"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R167 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.Isdn, contacts[10].PhoneNumbers[0].Key, 167, @"[In t:PhoneNumberKeyType Simple Type] Isdn: Identifies the telephone number as an Integrated Services Digital Network (ISDN) line."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R168"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R168 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.MobilePhone, contacts[11].PhoneNumbers[0].Key, 168, @"[In t:PhoneNumberKeyType Simple Type] MobilePhone: Identifies the telephone number as a mobile phone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R169"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R169 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.OtherFax, contacts[12].PhoneNumbers[0].Key, 169, @"[In t:PhoneNumberKeyType Simple Type] OtherFax: Identifies the telephone number as another fax number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R170"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R170 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.OtherTelephone, contacts[13].PhoneNumbers[0].Key, 170, @"[In t:PhoneNumberKeyType Simple Type] OtherTelephone: Identifies the telephone number as another telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R171"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R171 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.Pager, contacts[14].PhoneNumbers[0].Key, 171, @"[In t:PhoneNumberKeyType Simple Type] Pager: Identifies the telephone number as a pager."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R172"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R172 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.PrimaryPhone, contacts[15].PhoneNumbers[0].Key, 172, @"[In t:PhoneNumberKeyType Simple Type] PrimaryPhone: Identifies the telephone number as the primary telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R173"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R173 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.RadioPhone, contacts[16].PhoneNumbers[0].Key, 173, @"[In t:PhoneNumberKeyType Simple Type] RadioPhone: Identifies the telephone number as a radio telephone."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R174"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R174 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.Telex, contacts[17].PhoneNumbers[0].Key, 174, @"[In t:PhoneNumberKeyType Simple Type] Telex: Identifies the telephone number as a telex telephone number."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R175"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R175 Site.CaptureRequirementIfAreEqual<PhoneNumberKeyType>( PhoneNumberKeyType.TtyTddPhone, contacts[18].PhoneNumbers[0].Key, 175, @"[In t:PhoneNumberKeyType Simple Type] TtyTddPhone: Identifies the telephone number as a teletype/telecommunication device for the deaf (TTY/TDD) telephone number."); #endregion }
/// <summary> /// Create an item in the specified folder. /// </summary> /// <param name="parentFolderType">Type of the parent folder.</param> /// <param name="parentFolderId">ID of the parent folder.</param> /// <param name="itemSubject">Subject of the item which should be created.</param> /// <returns>ID of the created item.</returns> protected ItemIdType CreateItem(DistinguishedFolderIdNameType parentFolderType, string parentFolderId, string itemSubject) { // Create a request for the CreateItem operation and initialize the ItemType instance. CreateItemType createItemRequest = new CreateItemType(); ItemType item = null; // Get different values for item based on different parent folder type. switch (parentFolderType) { case DistinguishedFolderIdNameType.contacts: ContactItemType contact = new ContactItemType(); contact.Subject = itemSubject; contact.FileAs = itemSubject; item = contact; break; case DistinguishedFolderIdNameType.calendar: // Set the sendMeetingInvitations property. CalendarItemCreateOrDeleteOperationType sendMeetingInvitations = CalendarItemCreateOrDeleteOperationType.SendToNone; createItemRequest.SendMeetingInvitations = (CalendarItemCreateOrDeleteOperationType)sendMeetingInvitations; createItemRequest.SendMeetingInvitationsSpecified = true; CalendarItemType calendar = new CalendarItemType(); calendar.Subject = itemSubject; item = calendar; break; case DistinguishedFolderIdNameType.inbox: MessageType message = new MessageType(); message.Subject = itemSubject; item = message; break; case DistinguishedFolderIdNameType.tasks: TaskType taskItem = new TaskType(); taskItem.Subject = itemSubject; item = taskItem; break; default: Site.Assert.Fail("The parent folder type '{0}' is invalid and the valid folder types are: contacts, calendar, inbox and tasks.", parentFolderType.ToString()); break; } // Set the MessageDisposition property. MessageDispositionType messageDisposition = MessageDispositionType.SaveOnly; createItemRequest.MessageDisposition = (MessageDispositionType)messageDisposition; createItemRequest.MessageDispositionSpecified = true; // Specify the folder in which new items are saved. createItemRequest.SavedItemFolderId = new TargetFolderIdType(); FolderIdType folderId = new FolderIdType(); folderId.Id = parentFolderId; createItemRequest.SavedItemFolderId.Item = folderId; // Specify the collection of items to be created. createItemRequest.Items = new NonEmptyArrayOfAllItemsType(); createItemRequest.Items.Items = new ItemType[] { item }; // Initialize the ID of the created item. ItemIdType createdItemId = null; // Invoke the create item operation and get the response. CreateItemResponseType createItemResponse = this.COREAdapter.CreateItem(createItemRequest); if (createItemResponse != null && createItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Success) { ItemInfoResponseMessageType info = createItemResponse.ResponseMessages.Items[0] as ItemInfoResponseMessageType; Site.Assert.IsNotNull(info, "The items in CreateItem response should not be null."); // Get the ID of the created item. createdItemId = info.Items.Items[0].ItemId; } return createdItemId; }
public void MSOXWSSYNC_S02_TC06_SyncFolderItems_ContactItemType() { #region Step 1. Client invokes SyncFolderItems operation to get initial syncState of contacts folder. DistinguishedFolderIdNameType contactFolder = DistinguishedFolderIdNameType.contacts; SyncFolderItemsType request = this.CreateSyncFolderItemsRequestWithoutOptionalElements(contactFolder, DefaultShapeNamesType.AllProperties); SyncFolderItemsResponseType response = this.SYNCAdapter.SyncFolderItems(request); SyncFolderItemsResponseMessageType responseMessage = TestSuiteHelper.EnsureResponse<SyncFolderItemsResponseMessageType>(response); #endregion #region Step 2. Client invokes CreateItem to create a ContactItemType item and get its ID. ContactItemType contactItem = new ContactItemType(); ItemIdType[] itemIds = this.CreateItem(contactFolder, contactItem); #endregion #region Step 3. Client invokes SyncFolderItems operation with previous SyncState to sync the operation result in Step 2 and verify related requirements. // Call SyncFolderItems operation to verify the Ignore element after creating an item on server SyncFolderItemsType requestWithIgnoreElement = this.CreateSyncFolderItemsRequestWithoutOptionalElements(contactFolder, DefaultShapeNamesType.AllProperties); // Involve Ignore element in SyncFolderItems request requestWithIgnoreElement.SyncState = responseMessage.SyncState; requestWithIgnoreElement.Ignore = new ItemIdType[] { itemIds[0] }; SyncFolderItemsResponseType responseWithIgnoreElement = this.SYNCAdapter.SyncFolderItems(requestWithIgnoreElement); SyncFolderItemsResponseMessageType responseMessageWithIgnoreElement = TestSuiteHelper.EnsureResponse<SyncFolderItemsResponseMessageType>(responseWithIgnoreElement); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSSYNC_R3861"); // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R3861 Site.CaptureRequirementIfAreEqual<ResponseCodeType>( ResponseCodeType.NoError, responseMessageWithIgnoreElement.ResponseCode, 3861, @"[In m:SyncFolderItemsType Complex Type] This element [Ignore] is present, server responses NO_ERROR."); // Assert the changes in response is not null Site.Assert.IsNotNull(responseMessage.Changes, "There is one item created on server, so the changes between server and client should not be null"); SyncFolderItemsChangesType changesWithIgnoreElement = responseMessageWithIgnoreElement.Changes; // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify requirement MS-OXWSSYNC_R3851"); // If the items in Changes in SyncFolderItems response is null, in indicates the synchronization for the item is skipped. // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R3851 Site.CaptureRequirementIfIsNull( changesWithIgnoreElement.Items, 3851, @"[In m:SyncFolderItemsType Complex Type] If the item is in Ignore array, the synchronization is skipped."); // Call SyncFolderItems operation again without Ignore to get the CreateItem operation result responseMessage = this.GetResponseMessage(contactFolder, responseMessage, DefaultShapeNamesType.AllProperties); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSSYNC_R3862"); // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R3862 Site.CaptureRequirementIfAreEqual<ResponseCodeType>( ResponseCodeType.NoError, responseMessage.ResponseCode, 3862, @"[In m:SyncFolderItemsType Complex Type] This element [Ignore] is not present, server responses NO_ERROR."); // Assert the changes in response is not null Site.Assert.IsNotNull(responseMessage.Changes, "There is one item created on server, so the changes between server and client should not be null"); SyncFolderItemsChangesType changes = responseMessage.Changes; // Assert both the Items and ItemsElementName are not null Site.Assert.IsNotNull(changes.ItemsElementName, "There should be changes information returned in SyncFolderItems response since there is one item created on server."); Site.Assert.IsNotNull(changes.Items, "There should be item information returned in SyncFolderItems response since there is one item created on server."); Site.Assert.AreEqual<int>(1, changes.Items.Length, "Just one ContactItemType item was created in previous step, so the count of Items array in responseMessage.Changes should be 1."); // Add the debug information Site.Log.Add( LogEntryKind.Debug, "Verify MS-OXWSSYNC_R3852. Expected item type: {0}, actual item type: {1}", typeof(ContactItemType), (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.GetType()); // If there is one contact item in Changes in SyncFolderItems response, it indicates the synchronization for the item is not skipped. // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R3852 Site.CaptureRequirementIfIsInstanceOfType( (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item, typeof(ContactItemType), 3852, @"[In m:SyncFolderItemsType Complex Type] If the item is not in Ignore array, the synchronization is not skipped."); // If the type of item in SyncFolderItems response is ContactItemType, then requirement MS-OXWSSYNC_R160 can be captured. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSSYNC_R160"); // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R160 Site.CaptureRequirementIfIsInstanceOfType( (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item, typeof(ContactItemType), 160, @"[In t:SyncFolderItemsCreateOrUpdateType Complex Type] The type of Contact is t:ContactItemType ([MS-OXWSCONT] section 2.2.4.3)."); Site.Assert.AreEqual<int>(1, changes.ItemsElementName.Length, "Just one ContactItemType item was created in previous step, so the count of ItemsElementName array in responseMessage.Changes should be 1."); bool isContactItemCreated = changes.ItemsElementName[0] == ItemsChoiceType1.Create && (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.GetType() == typeof(ContactItemType); // Add the debug information Site.Log.Add( LogEntryKind.Debug, "Verify MS-OXWSSYNC_R1611. Expected value: ItemsElementName: {0}, item type: {1}; actual value: ItemsElementName: {2}, item type: {3}", ItemsChoiceType1.Create, typeof(ContactItemType), changes.ItemsElementName[0], (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.GetType()); // If the ItemsElementName of Changes is Create and the type of Item is ContactItemType, it indicates a contact // has been created on server and synced on client, then requirement MS-OXWSSYNC_R1611 can be captured. // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R1611 Site.CaptureRequirementIfIsTrue( isContactItemCreated, 1611, @"[In t:SyncFolderItemsCreateOrUpdateType Complex Type] [The element Contact] specifies a contact to create in the client message store."); #endregion #region Step 4. Client invokes UpdateItem operation to update the created item which created in Step 2. // Generate a new item subject string newItemSubject = Common.GenerateResourceName(this.Site, contactFolder + "NewItemSubject"); this.UpdateItemSubject(itemIds, newItemSubject); #endregion #region Step 5. Client invokes SyncFolderItems operation with previous SyncState to sync the operation result in Step 4 and verify related requirements. responseMessage = this.GetResponseMessage(contactFolder, responseMessage, DefaultShapeNamesType.AllProperties); // Assert the changes in response is not null Site.Assert.IsNotNull(responseMessage.Changes, "There is one item updated on server, so the changes between server and client should not be null"); changes = responseMessage.Changes; // Assert both the Items and ItemsElementName are not null Site.Assert.IsNotNull(changes.ItemsElementName, "There should be changes information returned in SyncFolderItems response since there is one item updated on server."); Site.Assert.IsNotNull(changes.Items, "There should be item information returned in SyncFolderItems response since there is one item updated on server."); Site.Assert.AreEqual<int>(1, changes.Items.Length, "Just one ContactItemType item was updated in previous step, so the count of Items array in responseMessage.Changes should be 1."); Site.Assert.AreEqual<int>(1, changes.ItemsElementName.Length, "Just one ContactItemType item was updated in previous step, so the count of ItemsElementName array in responseMessage.Changes should be 1."); bool isContactItemUpdated = changes.ItemsElementName[0] == ItemsChoiceType1.Update && (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.GetType() == typeof(ContactItemType); // Add the debug information Site.Log.Add( LogEntryKind.Debug, "Verify MS-OXWSSYNC_R1612. Expected value: ItemsElementName: {0}, item type: {1}; actual value: ItemsElementName: {2}, item type: {3}", ItemsChoiceType1.Update, typeof(ContactItemType), changes.ItemsElementName[0], (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.GetType()); // If the ItemsElementName of Changes is Update and the type of Item is TaskType, it indicates a task // has been updated on server and synced on client, then requirement MS-OXWSSYNC_R1612 can be captured. // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R1612 Site.CaptureRequirementIfIsTrue( isContactItemUpdated, 1612, @"[In t:SyncFolderItemsCreateOrUpdateType Complex Type] [The element Contact] specifies a contact to update in the client message store."); // Call SyncFolderItems again without SyncState to verify that all synchronization is returned. SyncFolderItemsType requestWithoutSyncState = this.CreateSyncFolderItemsRequestWithoutOptionalElements(contactFolder, DefaultShapeNamesType.AllProperties); response = this.SYNCAdapter.SyncFolderItems(requestWithoutSyncState); responseMessage = TestSuiteHelper.EnsureResponse<SyncFolderItemsResponseMessageType>(response); // Assert the changes in response is not null Site.Assert.IsNotNull(responseMessage.Changes, "There is one item updated on server, so the changes between server and client should not be null"); changes = responseMessage.Changes; // Assert both the Items and ItemsElementName are not null Site.Assert.IsNotNull(changes.ItemsElementName, "There should be changes information returned in SyncFolderItems response since there is one item updated on server."); Site.Assert.IsNotNull(changes.Items, "There should be item information returned in SyncFolderItems response since there is one item updated on server."); Site.Assert.AreEqual<ItemsChoiceType1>( ItemsChoiceType1.Create, changes.ItemsElementName[0], "After updating the item, if the SyncState element is not specified when calling SyncFolderItems, the changes between items on the client and the items on the server should be 'Create'"); Site.Assert.AreEqual<string>( newItemSubject, (changes.Items[0] as SyncFolderItemsCreateOrUpdateType).Item.Subject, "After updating the item, the subject of the item should be the expected one."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSSYNC_R382"); // If the changes is Create and the subject of the item is updated, it indicates the item in its current state is returned as if it has never been synchronized, // then requirement MS-OXWSSYNC_R382 can be captured. // Verify MS-OXWSSYNC requirement: MS-OXWSSYNC_R382 Site.CaptureRequirement( 382, @"[In m:SyncFolderItemsType Complex Type] If this element [SyncState] is not specified, If this element is not specified, all items in their current state are returned as if the items have never been synchronized. "); #endregion #region Step 6. Client invokes DeleteItem operation to delete the ContactItemType item which updated in Step 4. this.DeleteItem(itemIds); #endregion #region Step 7. Client invokes SyncFolderItems operation with previous SyncState to sync the operation result in Step 6. responseMessage = this.GetResponseMessage(contactFolder, responseMessage, DefaultShapeNamesType.AllProperties); // Assert the changes in response is not null Site.Assert.IsNotNull(responseMessage.Changes, "There is one item deleted on server, so the changes between server and client should not be null"); changes = responseMessage.Changes; // Assert both the Items and ItemsElementName are not null Site.Assert.IsNotNull(changes.ItemsElementName, "There should be changes information returned in SyncFolderItems response since there is one item deleted on server."); Site.Assert.IsNotNull(changes.Items, "There should be item information returned in SyncFolderItems response since there is one item deleted on server."); Site.Assert.AreEqual<int>(1, changes.Items.Length, "Just one ContactItemType item was deleted in previous step, so the count of Items array in responseMessage.Changes should be 1."); Site.Assert.IsTrue( changes.Items[0].GetType() == typeof(SyncFolderItemsDeleteType), string.Format("The responseMessage.Changes.Items should be an instance of '{0}'.", typeof(SyncFolderItemsDeleteType))); Site.Assert.AreEqual<int>(1, changes.ItemsElementName.Length, "Just one ContactItemType item was deleted in previous step, so the count of ItemsElementName array in responseMessage.Changes should be 1."); Site.Assert.IsTrue( changes.ItemsElementName[0] == ItemsChoiceType1.Delete, string.Format("The responseMessage.Changes.ItemsElementName should be 'Delete', the actual value is '{0}'", changes.ItemsElementName[0])); #endregion }
public void MSOXWSCORE_S02_TC03_MoveContactItemSuccessfully() { #region Step 1: Create the contact item. ContactItemType item = new ContactItemType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2: Move the contact item. // Clear ExistItemIds for MoveItem. this.InitializeCollection(); // Call MoveItem operation. MoveItemResponseType moveItemResponse = this.CallMoveItemOperation(DistinguishedFolderIdNameType.inbox, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(moveItemResponse, 1, this.Site); ItemIdType[] movedItemIds = Common.GetItemIdsFromInfoResponse(moveItemResponse); // One moved contact item should be returned. Site.Assert.AreEqual<int>( 1, movedItemIds.GetLength(0), "One moved contact item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, movedItemIds.GetLength(0)); #endregion #region Step 3: Get the created contact item failed. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); Site.Assert.AreEqual<int>( 1, getItemResponse.ResponseMessages.Items.GetLength(0), "Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemResponse.ResponseMessages.Items.GetLength(0)); Site.Assert.AreEqual<ResponseClassType>( ResponseClassType.Error, getItemResponse.ResponseMessages.Items[0].ResponseClass, string.Format( "Get contact item operation should be failed with error! Actual response code: {0}", getItemResponse.ResponseMessages.Items[0].ResponseCode)); #endregion #region Step 4: Get the moved contact item. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(movedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One contact item should be returned. Site.Assert.AreEqual<int>( 1, getItemIds.GetLength(0), "One contact item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }