public void TestCase_S15_TC03_Download_UploadPartial()
        {
            string fileUrl       = Common.GetConfigurationPropertyValue("BigFile", this.Site);
            string uploadFileUrl = SharedTestSuiteHelper.GenerateNonExistFileUrl(Site);
            bool   partial       = false;

            Knowledge knowledge = null;

            // Set the limit number of upload tries, this will allow 500000 * 10 bytes size file to be download and complete upload.
            int limitNumberOfPartialUpload = 10;

            do
            {
                this.InitializeContext(fileUrl, this.UserName01, this.Password01, this.Domain);

                // Create query changes request with allow fragments flag with the value false.
                FsshttpbCellRequest        cellRequest = SharedTestSuiteHelper.CreateFsshttpbCellRequest();
                QueryChangesCellSubRequest queryChange = SharedTestSuiteHelper.BuildFsshttpbQueryChangesSubRequest(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), 0, false, false, true, 0, true, true, 0, null, 500000, null, knowledge);
                cellRequest.AddSubRequest(queryChange, null);
                CellSubRequestType cellSubRequest = SharedTestSuiteHelper.CreateCellSubRequest(SequenceNumberGenerator.GetCurrentToken(), cellRequest.ToBase64());

                CellStorageResponse cellStorageResponse = this.Adapter.CellStorageRequest(fileUrl, new SubRequestType[] { cellSubRequest });
                CellSubResponseType subResponse         = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(cellStorageResponse, 0, 0, this.Site);
                this.Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                    "Test case cannot continue unless the query changes succeed.");

                FsshttpbResponse queryResponse = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponse, this.Site);
                SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(queryResponse, this.Site);
                QueryChangesSubResponseData data = queryResponse.CellSubResponses[0].GetSubResponseData <QueryChangesSubResponseData>();
                partial   = data.PartialResult;
                knowledge = data.Knowledge;

                this.InitializeContext(uploadFileUrl, this.UserName01, this.Password01, this.Domain);
                cellRequest = SharedTestSuiteHelper.CreateFsshttpbCellRequest();
                PutChangesCellSubRequest putChange = new PutChangesCellSubRequest(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), null);
                putChange.Partial     = partial ? 1 : 0;
                putChange.PartialLast = partial ? 0 : 1;
                putChange.StorageIndexExtendedGUID = partial ? null : data.StorageIndexExtendedGUID;

                if (partial)
                {
                    var storageIndex = queryResponse.DataElementPackage.DataElements.FirstOrDefault(e => e.DataElementType == DataElementType.StorageIndexDataElementData);
                    if (storageIndex != null)
                    {
                        queryResponse.DataElementPackage.DataElements.Remove(storageIndex);
                    }
                }

                cellRequest.AddSubRequest(putChange, queryResponse.DataElementPackage.DataElements);
                cellSubRequest = SharedTestSuiteHelper.CreateCellSubRequest(SequenceNumberGenerator.GetCurrentToken(), cellRequest.ToBase64());

                cellStorageResponse = this.Adapter.CellStorageRequest(uploadFileUrl, new SubRequestType[] { cellSubRequest });
                subResponse         = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(cellStorageResponse, 0, 0, this.Site);
                this.Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                    "Test case cannot continue unless the query changes succeed.");

                FsshttpbResponse putResponse = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponse, this.Site);
                SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(putResponse, this.Site);

                // Decrease the number of upload tries.
                limitNumberOfPartialUpload--;
            }while (partial && limitNumberOfPartialUpload > 0);

            this.StatusManager.RecordFileUpload(uploadFileUrl);
        }