Microsoft.Protocols.TestSuites.SharedTestSuite.S07_EditorsTable.TestCase_S07_TC13_EditorsTable_ReadOnlyUser C# (CSharp) Method

TestCase_S07_TC13_EditorsTable_ReadOnlyUser() private method

private TestCase_S07_TC13_EditorsTable_ReadOnlyUser ( ) : void
return void
        public void TestCase_S07_TC13_EditorsTable_ReadOnlyUser()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 9001, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support the editors table.");
            }

            string readOnlyUser = Common.GetConfigurationPropertyValue("ReadOnlyUser", this.Site);
            string readOnlyUserPassword = Common.GetConfigurationPropertyValue("ReadOnlyUserPwd", this.Site);

            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, readOnlyUser, readOnlyUserPassword, this.Domain);

            // Create a join editor session object.
            EditorsTableSubRequestType join = SharedTestSuiteHelper.CreateEditorsTableSubRequestForJoinSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.DefaultTimeOut);

            // Call protocol adapter operation CellStorageRequest to join the editing session.
            CellStorageResponse cellStorageResponseJoin = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { join });
            EditorsTableSubResponseType subResponseJoin = SharedTestSuiteHelper.ExtractSubResponse<EditorsTableSubResponseType>(cellStorageResponseJoin, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the ErrorCode attribute returned does not equal "Success", then MS-FSSHTTP_R1738 and MS-FSSHTTP_R3050 can be covered.
                Site.CaptureRequirementIfAreNotEqual<ErrorCodeType>(
                         ErrorCodeType.Success,
                         SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                         "MS-FSSHTTP",
                         1738,
                         @"[In EditorsTableSubRequestDataType][AsEditor] The server MUST NOT allow a user with read-only access to join the editing session as a reader.");

                Site.CaptureRequirementIfAreNotEqual<ErrorCodeType>(
                         ErrorCodeType.Success,
                         SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                         "MS-FSSHTTP",
                         3050,
                         @"[In SubRequestDataOptionalAttributes][AsEditor] The server MUST NOT allow a user with read-only access to join the editing session as a reader.");
            }
            else
            {
                Site.Assert.AreNotEqual<ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                    @"[In EditorsTableSubRequestDataType][AsEditor] The server MUST NOT allow a user with read-only access to join the editing session as a reader.");
            }
        }