public void MSFSSHTTP_FSSHTTPB_S02_TC03_CoauthSubRequest_FileAlreadyCheckedOutOnServer()
        {
            // Use SUT method to check out the file.
            if (!this.SutManagedAdapter.CheckOutFile(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain))
            {
                this.Site.Assert.Fail("Cannot change the file {0} to check out status using the user name {1} and password {2}", this.DefaultFileUrl, this.UserName02, this.Password02);
            }

            this.StatusManager.RecordFileCheckOut(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain);

            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Join a Coauthoring session, if the coauthorable file is checked out on the server and is checked out by a client with a different user name, the server returns a FileAlreadyCheckedOutOnServer error code.
            // Now the web service is initialized using the user01, so the user is different with the user who check the file out.
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1555
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileAlreadyCheckedOutOnServer,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    1555,
                    @"[In Join Coauthoring Session]  If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.FileAlreadyCheckedOutOnServer,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    @"[When sending Join Coauthoring Session subrequest] If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
            }

            bool isVerifyR385 = joinResponse.ErrorMessage != null && joinResponse.ErrorMessage.IndexOf(this.UserName02, StringComparison.OrdinalIgnoreCase) >= 0;

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "For the requirement MS-FSSHTTP_R385, the error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    joinResponse.ErrorMessage);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR385,
                    "MS-FSSHTTP",
                    385,
                    @"[In LockAndCoauthRelatedErrorCodeTypes][FileAlreadyCheckedOutOnServer] When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }
            else
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "The error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    joinResponse.ErrorMessage);

                Site.Assert.IsTrue(
                    isVerifyR385,
                    @"When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }

            // Refresh the Coauthoring Session, if the coauthorable file is checked out on the server and is checked out by a client with a different user name,
            // the server returns a FileAlreadyCheckedOutOnServer error code.
            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForRefreshCoauthoringSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType refreshResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            isVerifyR385 = refreshResponse.ErrorMessage != null && refreshResponse.ErrorMessage.IndexOf(this.UserName02, StringComparison.OrdinalIgnoreCase) >= 0;
            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1566, this.Site))
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1566
                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(refreshResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        1566,
                        @"[In Refresh Coauthoring Session][When sending Refresh Coauthoring Session subrequest] If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "For the requirement MS-FSSHTTP_R385, the error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    refreshResponse.ErrorMessage);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR385,
                    "MS-FSSHTTP",
                    385,
                    @"[In LockAndCoauthRelatedErrorCodeTypes][FileAlreadyCheckedOutOnServer] When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }
            else
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1566, this.Site))
                {
                    Site.Assert.AreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(refreshResponse.ErrorCode, this.Site),
                        @"[When sending Refresh Coauthoring Session subrequest]If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }

                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "The error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    refreshResponse.ErrorMessage);

                Site.Assert.IsTrue(
                    isVerifyR385,
                    @"When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }

            // Check Lock Availability of the Coauthoring Session, if the file is already checked out by a different user,
            // the server returns a FileAlreadyCheckedOutOnServer error code.
            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForCheckLockAvailability(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType checkResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            // Add the log information.
            Site.Log.Add(LogEntryKind.Debug, "The errorCode for Check Lock Availability SubRequest is :{0}", checkResponse.ErrorCode);
            if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1082, this.Site))
            {
                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1082
                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(checkResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        1082,
                        @"[In Check Lock Availability] If the coauthorable file is checked out on the server and it is checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
                else
                {
                    Site.Assert.AreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(checkResponse.ErrorCode, this.Site),
                        @"[When sending check lock availability subrequest]If the coauthorable file is checked out on the server and it is checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
            }
        }