Example #1
0
        public void MSWEBSS_S07_TC06_UpdateColumns_Unauthenticated()
        {
            Adapter.InitializeService(UserAuthentication.Unauthenticated);

            try
            {
                UpdateColumnsMethod[]  newFileds    = new UpdateColumnsMethod[1];
                UpdateColumnsMethod1[] updateFileds = new UpdateColumnsMethod1[1];
                UpdateColumnsMethod2[] deleteFileds = new UpdateColumnsMethod2[1];
                Adapter.UpdateColumns(
                    newFileds,
                    updateFileds,
                    deleteFileds);
                Site.Assert.Fail("The expected http status code is not returned for the UpdateColumns operation.");
            }
            catch (WebException exp)
            {
                if (exp.Response == null)
                {
                    throw;
                }

                // Verify MS-WEBSS requirement: MS-WEBSS_R1086
                // COMMENT: When the UpdateColumns operation is invoked by unauthenticated user, if the
                // server return the expected http status code, then the requirement can be captured.
                HttpWebResponse resp = exp.Response as HttpWebResponse;
                Site.CaptureRequirementIfAreEqual <HttpStatusCode>(
                    HttpStatusCode.Unauthorized,
                    resp.StatusCode,
                    1086,
                    @"[In Message Processing Events and Sequencing Rules] If the user is not authorized to perform the operation[UpdateColumns], the protocol server MUST return an HTTP 401 error as specified in [RFC2616] section 10.4.");
            }
        }
Example #2
0
        public void MSWEBSS_S07_TC02_GetColumns_WithInvalidColumn()
        {
            #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.FieldNameForUpdate;
            Adapter.UpdateColumns(null, updateFields, null);
            #endregion

            try
            {
                Adapter.GetColumns();
                Site.Assert.Fail("The expected SOAP fault is not returned for the GetListTemplates operation.");
            }
            catch (SoapException)
            {
                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R165
                Site.CaptureRequirement(
                    165,
                    @"[In GetColumns] If the operation fails, the protocol server MUST return a SOAP exception.");

                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R166
                Site.CaptureRequirement(
                    166,
                    @"[In GetColumns] A SOAP fault MUST be returned when a GetColumns operation is performed on a context site that has invalid column attribute information.");
            }
        }
Example #3
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]");
            }
        }
Example #4
0
        public void MSWEBSS_S07_TC08_UpdateColumns_UpdateFieldWithMultipleMethodNoFields()
        {
            #region Set up the environment
            this.InitUpdateColumn();
            UpdateColumnsMethod1[] updateFields = new UpdateColumnsMethod1[2];
            updateFields[0]                   = new UpdateColumnsMethod1();
            updateFields[0].Field             = new FieldDefinition();
            updateFields[0].Field.Name        = this.GenerateRandomString(10);
            updateFields[0].Field.Type        = Common.GetConfigurationPropertyValue("UpdateColumns_Type", this.Site);
            updateFields[0].Field.DisplayName = this.GenerateRandomString(10);
            updateFields[0].ID                = ((uint)CONST_MethodIDUNITS.Three).ToString();

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

            #endregion

            try
            {
                Adapter.UpdateColumns(null, updateFields, null);
                Site.Assert.Fail("The expected SOAP fault is not returned for the UpdateColumns operation.");
            }
            catch (SoapException)
            {
                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R734
                Site.CaptureRequirement(
                    734,
                    @"[In UpdateColumnsResponse] [A SOAP fault MUST be returned if the protocol server encounters the following error condition while running this operation] Occurs when one of the updateFields  elements of the UpdateColumns element has multiple Method elements without a Fields element defined as the root element.");

                // Verify MS-WEBSS requirement: MS-WEBSS_R1090
                Site.CaptureRequirement(
                    1090,
                    @"[In UpdateColumnsResponse] [A SOAP fault MUST be returned if the protocol server encounters the following error condition while running this operation] Occurs when one of the updateFields elements of the UpdateColumns element has multiple Method elements without a Fields element defined as the root element.");
            }
        }
        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
        }
        public void MSWEBSS_S07_TC08_UpdateColumns_UpdateFieldWithMultipleMethodNoFields()
        {
            #region Set up the environment
            this.InitUpdateColumn();
            UpdateColumnsMethod1[] updateFields = new UpdateColumnsMethod1[2];
            updateFields[0] = new UpdateColumnsMethod1();
            updateFields[0].Field = new FieldDefinition();
            updateFields[0].Field.Name = this.GenerateRandomString(10);
            updateFields[0].Field.Type = Common.GetConfigurationPropertyValue("UpdateColumns_Type", this.Site);
            updateFields[0].Field.DisplayName = this.GenerateRandomString(10);
            updateFields[0].ID = ((uint)CONST_MethodIDUNITS.Three).ToString();

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

            #endregion

            try
            {
                Adapter.UpdateColumns(null, updateFields, null);
                Site.Assert.Fail("The expected SOAP fault is not returned for the UpdateColumns operation.");
            }
            catch (SoapException)
            {
                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R734
                Site.CaptureRequirement(
                    734,
                   @"[In UpdateColumnsResponse] [A SOAP fault MUST be returned if the protocol server encounters the following error condition while running this operation] Occurs when one of the updateFields  elements of the UpdateColumns element has multiple Method elements without a Fields element defined as the root element.");

                // Verify MS-WEBSS requirement: MS-WEBSS_R1090
                Site.CaptureRequirement(
                    1090,
                @"[In UpdateColumnsResponse] [A SOAP fault MUST be returned if the protocol server encounters the following error condition while running this operation] Occurs when one of the updateFields elements of the UpdateColumns element has multiple Method elements without a Fields element defined as the root element.");
            }
        }
        public void MSWEBSS_S07_TC06_UpdateColumns_Unauthenticated()
        {
            Adapter.InitializeService(UserAuthentication.Unauthenticated);

            try
            {
                UpdateColumnsMethod[] newFileds = new UpdateColumnsMethod[1];
                UpdateColumnsMethod1[] updateFileds = new UpdateColumnsMethod1[1];
                UpdateColumnsMethod2[] deleteFileds = new UpdateColumnsMethod2[1];
                Adapter.UpdateColumns(
                    newFileds,
                    updateFileds,
                    deleteFileds);
                Site.Assert.Fail("The expected http status code is not returned for the UpdateColumns operation.");
            }
            catch (WebException exp)
            {
                if (exp.Response == null)
                {
                    throw;
                }

                // Verify MS-WEBSS requirement: MS-WEBSS_R1086
                // COMMENT: When the UpdateColumns operation is invoked by unauthenticated user, if the 
                // server return the expected http status code, then the requirement can be captured.
                HttpWebResponse resp = exp.Response as HttpWebResponse;
                Site.CaptureRequirementIfAreEqual<HttpStatusCode>(
                    HttpStatusCode.Unauthorized,
                    resp.StatusCode,
                     1086,
                 @"[In Message Processing Events and Sequencing Rules] If the user is not authorized to perform the operation[UpdateColumns], the protocol server MUST return an HTTP 401 error as specified in [RFC2616] section 10.4.");
            }
        }
        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]");
            }
        }
        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
        }
        public void MSWEBSS_S07_TC02_GetColumns_WithInvalidColumn()
        {
            #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.FieldNameForUpdate;
            Adapter.UpdateColumns(null, updateFields, null);
            #endregion

            try
            {
                Adapter.GetColumns();
                Site.Assert.Fail("The expected SOAP fault is not returned for the GetListTemplates operation.");
            }
            catch (SoapException)
            {
                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R165
                Site.CaptureRequirement(
                    165,
                    @"[In GetColumns] If the operation fails, the protocol server MUST return a SOAP exception.");

                // Catch the exception, then the following requirements will be captured.
                // Verify MS-WEBSS requirement: MS-WEBSS_R166
                Site.CaptureRequirement(
                    166,
                    @"[In GetColumns] A SOAP fault MUST be returned when a GetColumns operation is performed on a context site that has invalid column attribute information.");
            }
        }
Example #11
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
        }
Example #12
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
        }
        /// <summary>
        /// This operation is used to perform the following operation on the context site and all child sites within its hierarchy
        /// <ul>
        ///     <li>Adding one or more specified new columns</li>
        ///     <li>Updating one or more specified existing columns</li>
        ///     <li>Deleting one or more specified existing columns</li>
        /// </ul>
        /// </summary>
        /// <param name="newFields">newFields is an XML element that represents the collection of columns to be added to the context site and all child sites within its hierarchy.</param>
        /// <param name="updateFields">updateFields is an XML element that represents the collection of columns to be updated on the context site and all child sites within its hierarchy</param>
        /// <param name="deleteFields">deleteFields is an XML element that represents the collection of columns to be deleted from the context site and all child sites within its hierarchy</param>
        /// <returns>The result of UpdateColumns.</returns>
        public UpdateColumnsResponseUpdateColumnsResult UpdateColumns(UpdateColumnsMethod[] newFields, UpdateColumnsMethod1[] updateFields, UpdateColumnsMethod2[] deleteFields)
        {
            UpdateColumnsResponseUpdateColumnsResult updateColumnsResponseUpdateColumnsResult = null;

            updateColumnsResponseUpdateColumnsResult = this.service.UpdateColumns(newFields, updateFields, deleteFields);

            this.ValidateUpdateColumns();
            this.CaptureTransportRelatedRequirements();

            return updateColumnsResponseUpdateColumnsResult;
        }