Exemple #1
0
        public void MSFSSHTTP_FSSHTTPB_TestCase_S16_TC01_Versioning_EmptyUrl()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            VersioningSubRequestType versioningSubRequest = SharedTestSuiteHelper.CreateVersioningSubRequest(SequenceNumberGenerator.GetCurrentToken(), VersioningRequestTypes.GetVersionList, null, this.Site);
            CellStorageResponse      cellStoreageResponse = Adapter.CellStorageRequest(string.Empty, new SubRequestType[] { versioningSubRequest });

            if (Common.IsRequirementEnabled(11151, this.Site))
            {
                SubResponseType subResponse = cellStoreageResponse.ResponseCollection.Response[0].SubResponse[0];
                ErrorCodeType   errorCode   = SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site);

                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R11151
                    Site.CaptureRequirementIfAreNotEqual <ErrorCodeType>(
                        ErrorCodeType.Success,
                        errorCode,
                        "MS-FSSHTTP",
                        11151,
                        @"[In VersioningSubResponseType] 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 <ErrorCodeType>(
                        ErrorCodeType.Success,
                        errorCode,
                        "Error should occur if call versioning request with empty url.");
                }
            }
        }
Exemple #2
0
        public void MSFSSHTTP_FSSHTTPB_TestCase_S17_TC01_FileOperation_EmptyUrl()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            string fileName = this.DefaultFileUrl.Substring(this.DefaultFileUrl.LastIndexOf("/", System.StringComparison.OrdinalIgnoreCase) + 1);
            string newName  = Common.GenerateResourceName(this.Site, "fileName") + ".txt";

            FileOperationSubRequestType fileoperationSubRequest = SharedTestSuiteHelper.CreateFileOperationSubRequest(FileOperationRequestTypes.Rename, newName, null, this.Site);

            CellStorageResponse cellStoreageResponse = Adapter.CellStorageRequest(string.Empty, new SubRequestType[] { fileoperationSubRequest });

            if (Common.IsRequirementEnabled(11121, this.Site))
            {
                SubResponseType subresponse = cellStoreageResponse.ResponseCollection.Response[0].SubResponse[0];

                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R11121
                    Site.CaptureRequirementIfAreNotEqual <string>(
                        GenericErrorCodeTypes.Success.ToString(),
                        subresponse.ErrorCode,
                        "MS-FSSHTTP",
                        11121,
                        @"[In FileOperationSubResponseType] 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>(
                        GenericErrorCodeTypes.Success.ToString(),
                        subresponse.ErrorCode,
                        "Error should occur if call fileoperation request with empty url.");
                }
            }
        }
        public void TestCase_S19_TC01_LockStatus_Success()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            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);

            LockStatusSubRequestType lockStatus = SharedTestSuiteHelper.CreateLockStatusSubRequest();

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

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Capture the requirement MS-FSSHTTP_R246601
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    246601,
                    @"[In Appendix B: Product Behavior] Implementation does support LockStatus operation. (SharePoint Server 2016 and above follow this behavior.)");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2272
                Site.CaptureRequirementIfAreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "MS-FSSHTTP",
                    2272,
                    @"[LockStatusSubResponseType]In the case of success, it contains information requested as part of a LockStatus subrequest. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R401011
                Site.CaptureRequirementIfAreEqual <int>(
                    1,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    "MS-FSSHTTP",
                    401011,
                    @"[In LockTypes] 1: The integer value ""1"", indicating a shared lock on the file.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "In the case of success, it contains information requested as part of a LockStatus subrequest. ");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_TestCase_S19_TC01_LockStatus_ExclusiveLock()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Disable the Coauthoring Feature
            bool isSwitchedSuccessfully = SutPowerShellAdapter.SwitchCoauthoringFeature(true);

            this.Site.Assert.IsTrue(isSwitchedSuccessfully, "The Coauthoring Feature should be disabled.");
            this.StatusManager.RecordDisableCoauth();

            // Waiting change takes effect
            System.Threading.Thread.Sleep(30 * 1000);

            // Join a Coauthoring session
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, true, SharedTestSuiteHelper.DefaultExclusiveLockID);
            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.DefaultExclusiveLockID));
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.DefaultExclusiveLockID);

            LockStatusSubRequestType lockStatus = SharedTestSuiteHelper.CreateLockStatusSubRequest();

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

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R404011
                Site.CaptureRequirementIfAreEqual <int>(
                    2,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    "MS-FSSHTTP",
                    404011,
                    @"[In LockTypes] 2: The integer value ""2"", indicating an exclusive lock on the file.");
            }
            else
            {
                Site.Assert.AreEqual <int>(
                    2,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    @"2: The integer value ""2"", indicating an exclusive lock on the file.");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_TestCase_S20_TC01_Properties_ErrorCode()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);
            string fileName = this.DefaultFileUrl.Substring(this.DefaultFileUrl.LastIndexOf("/", System.StringComparison.OrdinalIgnoreCase) + 1);

            PropertyIdType property = new PropertyIdType();

            property.id = fileName;
            PropertyIdType[] propertyId = new PropertyIdType[] { property };

            PropertiesSubRequestType propertiess = SharedTestSuiteHelper.CreatePropertiesSubRequest(SequenceNumberGenerator.GetCurrentToken(), PropertiesRequestTypes.PropertyGet, propertyId, this.Site);
            CellStorageResponse      response    = this.Adapter.CellStorageRequest(null, new SubRequestType[] { propertiess });

            if (Common.IsRequirementEnabled(2302011, this.Site))
            {
                PropertiesSubResponseType propertiesResponse = SharedTestSuiteHelper.ExtractSubResponse <PropertiesSubResponseType>(response, 0, 0, this.Site);
                SubResponseType           subresponse        = response.ResponseCollection.Response[0].SubResponse[0];

                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2302011
                    Site.CaptureRequirementIfAreNotEqual <string>(
                        GenericErrorCodeTypes.Success.ToString(),
                        subresponse.ErrorCode,
                        "MS-FSSHTTP",
                        2302011,
                        @"[PropertiesSubResponseType]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>(
                        GenericErrorCodeTypes.Success.ToString(),
                        subresponse.ErrorCode,
                        "In the case of failure, the ErrorCode attribute that is part of a SubResponse element specifies the error code result for this subrequest.");
                }
            }
        }
Exemple #6
0
 public Response(ResponseState state, SubResponseType subState, string message)
 {
     this.state    = state;
     this.subState = subState;
     this.message  = message;
 }
        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. ");
            }
        }
        public void TestCase_S20_TC01_Properties_Success()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            string[]       ids        = new string[] { "RealtimeTypingEndpointUrl", "DocumentAccessToken", "DocumentAccessTokenTtl" };
            PropertyIdType propertyId = new PropertyIdType();

            PropertyIdType[] propertyIds = new PropertyIdType[3];

            for (int i = 0; i < ids.Length; i++)
            {
                propertyId.id  = ids[i];
                propertyIds[i] = propertyId;
            }

            PropertiesSubRequestType properties = SharedTestSuiteHelper.CreatePropertiesSubRequest(SequenceNumberGenerator.GetCurrentToken(), PropertiesRequestTypes.PropertyGet, propertyIds, this.Site);

            CellStorageResponse       cellStorageResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { properties });
            PropertiesSubResponseType propertiesResponse  = SharedTestSuiteHelper.ExtractSubResponse <PropertiesSubResponseType>(cellStorageResponse, 0, 0, this.Site);
            SubResponseType           subresponse         = cellStorageResponse.ResponseCollection.Response[0].SubResponse[0];

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Capture the requirement MS-FSSHTTP_R246801
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    246801,
                    @"[In Appendix B: Product Behavior] Implementation does support Properties operation. (SharePoint Server 2016 and above follow this behavior.)");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2301011
                Site.CaptureRequirementIfAreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "MS-FSSHTTP",
                    2301011,
                    @"[PropertiesSubResponseType]In the case of success, it contains information requested as part of a Properties subrequest. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2443
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subresponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    2443,
                    @"[Properties Subrequest][The protocol server returns results based on the following conditions:]An ErrorCode value of ""Success"" indicates success in processing the Properties request.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2447
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2447,
                    @"[Property Get]If the Properties attribute is set to ""PropertyGet"", the protocol server considers the Properties subrequest to be of type ""Property Get "". ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2299
                Site.CaptureRequirementIfIsNotNull(
                    propertiesResponse.SubResponseData.PropertyValues,
                    "MS-FSSHTTP",
                    2299,
                    @"[PropertiesSubResponseDataType][PropertyValues]This element MUST only be included in the response if the Properties attribute value is set to ""PropertyGet"".");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "[PropertiesSubResponseType]In the case of success, it contains information requested as part of a Properties subrequest. ");
            }
        }