Exemplo n.º 1
0
        public void MSWEBSS_S07_TC04_UpdateColumns_NoMatchingName()
        {
            #region Set up the environment.
            this.InitUpdateColumn();
            UpdateColumnsMethod1[] updateFields = new UpdateColumnsMethod1[1];
            updateFields[0]            = new UpdateColumnsMethod1();
            updateFields[0].Field      = new FieldDefinition();
            updateFields[0].ID         = ((uint)CONST_MethodIDUNITS.Three).ToString();
            updateFields[0].Field.Name = this.GenerateRandomString(10);
            updateFields[0].Field.Type = Common.GetConfigurationPropertyValue("UpdateColumns_Type", this.Site);

            UpdateColumnsMethod2[] deleteFields = new UpdateColumnsMethod2[1];
            deleteFields[0]            = new UpdateColumnsMethod2();
            deleteFields[0].Field      = new FieldDefinition();
            deleteFields[0].ID         = ((uint)CONST_MethodIDUNITS.Five).ToString();
            deleteFields[0].Field.Name = this.GenerateRandomString(10);
            #endregion .

            UpdateColumnsResponseUpdateColumnsResult updateColumnsResult = Adapter.UpdateColumns(null, updateFields, deleteFields);

            bool iscorrectResponseResultForDelete = (SoapErrorCode.ErrorCode0x80004005 == updateColumnsResult.Results.DeleteFields[0].ErrorCode) &&
                                                    (updateColumnsResult.Results.DeleteFields[0].ErrorText != null);

            Site.Assert.AreEqual <string>(
                SoapErrorCode.ErrorCode0x80004005,
                updateColumnsResult.Results.DeleteFields[0].ErrorCode,
                "The expected error code {0} of DeleteFields should be returned in the UpdateColumnsResponse element.",
                SoapErrorCode.ErrorCode0x80004005);

            Site.Assert.IsNotNull(updateColumnsResult.Results.DeleteFields[0].ErrorText, "The ErrorText of DeleteFields in UpdateColumnsResponse should not be null");

            // Verify MS-WEBSS requirement: MS-WEBSS_R832
            if (Common.IsRequirementEnabled(830, this.Site))
            {
                this.Site.CaptureRequirementIfIsTrue(
                    iscorrectResponseResultForDelete,
                    832,
                    @"[In UpdateColumnsResponse] If implementation does encounter one of the error conditions in the following table while running this operation, ErrorCode[0x80004005] and ErrorText elements MUST be returned in the UpdateColumnsResponse element, which contain one of the error codes in the following table for the specified error condition. [An invalid GUID is passed in as the ID attribute for updateFields and deleteFields.]
[The 2007 Microsoft® Office system
  Microsoft® Office 2010 suites
  Microsoft® Office SharePoint® Server 2007
  Windows® SharePoint® Services 3.0
  Microsoft® SharePoint® Foundation 2010
Microsoft® SharePoint® Foundation 2013]");
            }
        }
Exemplo n.º 2
0
        public void MSWEBSS_S07_TC12_UpdateColumns_InvalidGUID()
        {
            #region Set up the environment.
            this.InitUpdateColumn();
            UpdateColumnsMethod1[] updateFields = new UpdateColumnsMethod1[1];
            updateFields[0]            = new UpdateColumnsMethod1();
            updateFields[0].Field      = new FieldDefinition();
            updateFields[0].ID         = ((uint)CONST_MethodIDUNITS.Three).ToString();
            updateFields[0].Field.Name = this.GenerateRandomString(10);
            updateFields[0].Field.ID   = Guid.NewGuid().ToString();
            UpdateColumnsMethod2[] deleteFields = new UpdateColumnsMethod2[1];
            deleteFields[0]          = new UpdateColumnsMethod2();
            deleteFields[0].Field    = new FieldDefinition();
            deleteFields[0].ID       = ((uint)CONST_MethodIDUNITS.Five).ToString();
            deleteFields[0].Field.ID = Guid.NewGuid().ToString();

            #endregion

            UpdateColumnsResponseUpdateColumnsResult updateColumnsResult = Adapter.UpdateColumns(null, updateFields, deleteFields);

            #region Capture Invalid GUID Related Requirement
            bool isCorrectResponseResult = (SoapErrorCode.ErrorCode0x80004005 == updateColumnsResult.Results.DeleteFields[0].ErrorCode) &&
                                           (updateColumnsResult.Results.DeleteFields[0].ErrorText != null) &&
                                           (SoapErrorCode.ErrorCode0x80004005 == updateColumnsResult.Results.UpdateFields[0].ErrorCode) &&
                                           (updateColumnsResult.Results.UpdateFields[0].ErrorText != null);

            Site.Assert.AreEqual <string>(
                SoapErrorCode.ErrorCode0x80004005,
                updateColumnsResult.Results.DeleteFields[0].ErrorCode,
                "The expected error code {0} of DeleteFields should be returned in the UpdateColumnsResponse element.",
                SoapErrorCode.ErrorCode0x80004005);

            Site.Assert.IsNotNull(updateColumnsResult.Results.DeleteFields[0].ErrorText, "The ErrorText of DeleteFields in UpdateColumnsResponse should not be null");

            Site.Assert.AreEqual <string>(
                SoapErrorCode.ErrorCode0x80004005,
                updateColumnsResult.Results.UpdateFields[0].ErrorCode,
                "The expected error code {0} of UpdateFields should be returned in the UpdateColumnsResponse element.",
                SoapErrorCode.ErrorCode0x80004005);

            Site.Assert.IsNotNull(updateColumnsResult.Results.UpdateFields[0].ErrorText, "The ErrorText of UpdateFields in UpdateColumnsResponse should not be null");

            // Verify MS-WEBSS requirement: MS-WEBSS_R466
            Site.CaptureRequirementIfIsTrue(
                isCorrectResponseResult,
                466,
                @"[In UpdateColumns]  If an error occurs, the protocol server MUST return an appropriate error code and error string.");

            Site.CaptureRequirementIfIsTrue(
                isCorrectResponseResult,
                467,
                @"[In UpdateColumns] Error code(s) specific to this operation[UpdateColumns] are defined in UpdateColumnsResponse (section 3.1.4.18.2.2).");

            // Verify MS-WEBSS requirement: MS-WEBSS_R824
            Site.CaptureRequirementIfIsTrue(
                isCorrectResponseResult,
                824,
                @"[In UpdateColumnsResponse] If the protocol server encounters one of the error conditions[An invalid GUID is passed in as the ID attribute for updateFields and deleteFields.] in the following table while running this operation[UpdateColumns], ErrorCode[0x80004005] and ErrorText elements MUST be returned in the UpdateColumnsResponse element.");

            if (Common.IsRequirementEnabled(832, this.Site))
            {
                // Verify MS-WEBSS requirement: MS-WEBSS_R832
                this.Site.CaptureRequirementIfIsTrue(
                    isCorrectResponseResult,
                    832,
                    @"[In UpdateColumnsResponse] If implementation does encounter one of the error conditions in the following table while running this operation, ErrorCode[0x80004005] and ErrorText elements MUST be returned in the UpdateColumnsResponse element, which contain one of the error codes in the following table for the specified error condition. [An invalid GUID is passed in as the ID attribute for updateFields and deleteFields.]
[The 2007 Microsoft® Office system
  Microsoft® Office 2010 suites
  Microsoft® Office SharePoint® Server 2007
  Windows® SharePoint® Services 3.0
  Microsoft® SharePoint® Foundation 2010
Microsoft® SharePoint® Foundation 2013]");
            }
            #endregion
        }
Exemplo n.º 3
0
        public void MSWEBSS_S07_TC03_UpdateColumns_AllFieldsValid()
        {
            #region Set up the environment
            this.InitUpdateColumn();

            // Update to new interface
            UpdateColumnsMethod[] newFields = new UpdateColumnsMethod[1];
            newFields[0]            = new UpdateColumnsMethod();
            newFields[0].Field      = new FieldDefinition();
            newFields[0].ID         = ((uint)CONST_MethodIDUNITS.One).ToString();
            newFields[0].Field.Name = this.GenerateRandomString(10);
            newFields[0].Field.Type = Common.GetConfigurationPropertyValue("UpdateColumns_Type", this.Site);

            // Update to new interface
            UpdateColumnsMethod1[] updateFields = new UpdateColumnsMethod1[1];
            updateFields[0]                   = new UpdateColumnsMethod1();
            updateFields[0].Field             = new FieldDefinition();
            updateFields[0].ID                = ((uint)CONST_MethodIDUNITS.Three).ToString();
            updateFields[0].Field.Name        = this.GenerateRandomString(10);
            updateFields[0].Field.Type        = Common.GetConfigurationPropertyValue("UpdateColumns_Type", this.Site);
            updateFields[0].Field.DisplayName = this.GenerateRandomString(10);

            // Update to new interface
            UpdateColumnsMethod2[] deleteFields = new UpdateColumnsMethod2[1];
            deleteFields[0]            = new UpdateColumnsMethod2();
            deleteFields[0].Field      = new FieldDefinition();
            deleteFields[0].ID         = ((uint)CONST_MethodIDUNITS.Five).ToString();
            deleteFields[0].Field.Name = this.GenerateRandomString(10);

            #endregion

            UpdateColumnsResponseUpdateColumnsResult updateColumnsResult = Adapter.UpdateColumns(newFields, updateFields, deleteFields);

            #region Capture All Fields Valid Related Requirement
            // Verify MS-WEBSS requirement: MS-WEBSS_R465
            bool isVerifiedR465 = updateColumnsResult != null;
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR465,
                465,
                @"[In UpdateColumns] If the operation succeeds, it MUST return an UpdateColumnsResponse element.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R508
            Site.CaptureRequirementIfAreEqual <string>(
                newFields[0].ID,
                updateColumnsResult.Results.NewFields[0].ID,
                508,
                @"[In UpdateColumnsResponse] Method.ID: This attribute MUST have the same value as the Method.ID attribute that was sent to the protocol server in the UpdateColumns message of this UpdateColumnsResponse for an add operation.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R473
            Site.CaptureRequirementIfAreEqual <string>(
                newFields[0].ID,
                updateColumnsResult.Results.NewFields[0].ID,
                473,
                @"[In UpdateColumnsSoapOut] This message[UpdateColumnsSoapOut] is the response message to perform the following operations on the context site and all child sites in its hierarchy:
	Adding one or more specified new columns."    );

            // Verify MS-WEBSS requirement: MS-WEBSS_R837
            Site.CaptureRequirementIfAreEqual <string>(
                updateFields[0].ID,
                updateColumnsResult.Results.UpdateFields[0].ID,
                837,
                @"[In UpdateColumnsResponse] Method.ID: This attribute MUST have the same value as the Method.ID attribute that was sent to the protocol server in the UpdateColumns message of this UpdateColumnsResponse for an update operation.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R474
            Site.CaptureRequirementIfAreEqual <string>(
                updateFields[0].ID,
                updateColumnsResult.Results.UpdateFields[0].ID,
                474,
                @"[In UpdateColumnsSoapOut] Updating one or more specified existing columns.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R838
            Site.CaptureRequirementIfAreEqual <string>(
                deleteFields[0].ID,
                updateColumnsResult.Results.DeleteFields[0].ID,
                838,
                @"[In UpdateColumnsResponse] Method.ID: This attribute MUST have the same value as the Method.ID attribute that was sent to the protocol server in the UpdateColumns message of this UpdateColumnsResponse for a delete operation.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R475
            Site.CaptureRequirementIfAreEqual <string>(
                deleteFields[0].ID,
                updateColumnsResult.Results.DeleteFields[0].ID,
                475,
                @"[In UpdateColumnsSoapOut] Deleting one or more specified existing columns.");

            // Verify MS-WEBSS requirement: MS-WEBSS_R1037
            Site.Assert.IsFalse(!Common.IsRequirementEnabled(1037, this.Site), "This operation UpdateColumns failed.");
            if (Common.IsRequirementEnabled(1037, this.Site))
            {
                // If the operation UpdateColumns failed,verify MS-WEBSS requirement: MS-WEBSS_R1037
                Site.CaptureRequirement(
                    1037,
                    @"[In Appendix B: Product Behavior] Implementation does support this[UpdateColumns] operation.(<21> Windows SharePoint Services 3.0 and above follow this behavior.)");
            }

            #endregion
        }