Esempio n. 1
0
        public void MSFSSHTTP_FSSHTTPB_TestCase_S18_TC02_AmIAlone_Error()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            AmIAloneSubRequestType  amIAlone         = SharedTestSuiteHelper.CreateAmIAloneSubRequest();
            CellStorageResponse     response         = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { amIAlone });
            AmIAloneSubResponseType amIAloneResponse = SharedTestSuiteHelper.ExtractSubResponse <AmIAloneSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R22522
                Site.CaptureRequirementIfAreNotEqual <string>(
                    "Success",
                    amIAloneResponse.ErrorCode,
                    "MS-FSSHTTP",
                    22522,
                    @"[In AmIAloneSubResponseType]In the case of failure, the ErrorCode attribute that is part of a SubResponse element specifies the error code result for this subrequest. ");
            }
            else
            {
                Site.Assert.AreNotEqual <string>(
                    "Success",
                    amIAloneResponse.ErrorCode,
                    "In the case of failure, the ErrorCode attribute that is part of a SubResponse element specifies the error code result for this subrequest. ");
            }
        }
Esempio n. 2
0
        public void MSFSSHTTP_FSSHTTPB_TestCase_S18_TC01_AmIAlone_False()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Join Coauthoring session using the first user
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType subResponse  = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                string.Format("Account {0} with client ID {1} and schema lock ID {2} should join the coauthoring session successfully.", this.UserName01, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID));
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            // Join the Coauthoring session using the second user with same SchemaLockId
            this.InitializeContext(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain);
            string secondClientId = System.Guid.NewGuid().ToString();

            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(secondClientId, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType secondResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, secondClientId, SharedTestSuiteHelper.ReservedSchemaLockID, this.UserName02, this.Password02, this.Domain);

            string transitionId = secondResponse.SubResponseData.TransitionID;

            AmIAloneSubRequestType amIAlone = SharedTestSuiteHelper.CreateAmIAloneSubRequest();

            amIAlone.SubRequestData.TransitionID = transitionId;
            CellStorageResponse     response         = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { amIAlone });
            AmIAloneSubResponseType amIAloneResponse = SharedTestSuiteHelper.ExtractSubResponse <AmIAloneSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R224912
                Site.CaptureRequirementIfAreEqual <string>(
                    "False",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "MS-FSSHTTP",
                    224912,
                    @"[In AmIAloneSubResponseDataType]AmIAlone: False means the user is not alone in the coauthoring session.");

                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2181012
                //If MS-FSSHTTP224912 is verified, this requirement can be verified directly
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2181012,
                    @"[In SubResponseDataOptionalAttributes]AmIAlone: False means the user is not alone in the coauthoring session.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    "False",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "AmIAlone: False means the user is not alone in the coauthoring session.");
            }
        }
        public void TestCase_S18_TC01_AmIAlone_Success()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);
            // Join a Coauthoring session with time out value 3600.
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, null, null, 3600);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                "Test case cannot continue unless the user {0} using client id {1} and schema lock id {2} to join the coauthoring session succeed.",
                this.UserName01,
                SharedTestSuiteHelper.DefaultClientID,
                SharedTestSuiteHelper.ReservedSchemaLockID);
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            string transitionId = joinResponse.SubResponseData.TransitionID;

            AmIAloneSubRequestType amIAlone = SharedTestSuiteHelper.CreateAmIAloneSubRequest();

            amIAlone.SubRequestData.TransitionID = transitionId;

            CellStorageResponse     response         = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { amIAlone });
            AmIAloneSubResponseType amIAloneResponse = SharedTestSuiteHelper.ExtractSubResponse <AmIAloneSubResponseType>(response, 0, 0, this.Site);
            SubResponseType         subresponse      = response.ResponseCollection.Response[0].SubResponse[0];

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Capture the requirement MS-FSSHTTP_R246401
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    246401,
                    @"[In Appendix B: Product Behavior] Implementation does support AmIAlone operation. <60> (Microsoft SharePoint Foundation 2013/Microsoft SharePoint Server 2013 and above follow this behavior.)");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R224911
                Site.CaptureRequirementIfAreEqual <string>(
                    "True",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "MS-FSSHTTP",
                    224911,
                    @"[In AmIAloneSubResponseDataType]AmIAlone: True means the user is alone in the coauthoring session.");

                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2181011
                //If MS-FSSHTTP224911 is verified, this requirement can be verified directly
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2181011,
                    @"[In SubResponseDataOptionalAttributes]AmIAlone: True means the user is alone in the coauthoring session.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2251
                Site.CaptureRequirementIfAreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "MS-FSSHTTP",
                    2251,
                    @"[In AmIAloneSubResponseType]In the case of success, it contains information requested as part of an AmIAlone subrequest. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2374
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subresponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    2374,
                    @"[AmIAlone Subrequest][The protocol returns results based on the following conditions]Otherwise, the protocol server sets the error code value to ""Success"" to indicate success in processing the AmIAlone subrequest.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "In the case of success, it contains information requested as part of an AmIAlone subrequest. ");
            }
        }