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

TestCase_S07_TC11_EditorsTable_NotSupport_MinorVersionIsZero() private method

        public void TestCase_S07_TC11_EditorsTable_NotSupport_MinorVersionIsZero()
        {
            // Send a serverTimeSubRequest to get the current MinorVersion value.
            // Initialize the service
            string fileUrl = Common.GetConfigurationPropertyValue("NormalFile", this.Site);
            this.InitializeContext(fileUrl, this.UserName01, this.Password01, this.Domain);

            ServerTimeSubRequestType serverTimeSubRequest = SharedTestSuiteHelper.CreateServerTimeSubRequest(SequenceNumberGenerator.GetCurrentToken());
            CellStorageResponse cellStoreageResponse = Adapter.CellStorageRequest(fileUrl, new SubRequestType[] { serverTimeSubRequest });
            ServerTimeSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse<ServerTimeSubResponseType>(cellStoreageResponse, 0, 0, this.Site);
            this.Site.Assert.AreEqual<ErrorCodeType>(
                        ErrorCodeType.Success,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                        "Test case cannot continue unless the serverTime request succeeds.");

            if (cellStoreageResponse.ResponseVersion.MinorVersion == 0)
            {
                // 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(fileUrl, new SubRequestType[] { join });

                // Get the subResponse of EditorsTableSubResponseType
                EditorsTableSubResponseType subResponseJoin = SharedTestSuiteHelper.ExtractSubResponse<EditorsTableSubResponseType>(cellStorageResponseJoin, 0, 0, this.Site);

                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // If the ErrorCode attribute returned doesn't equal to "Success", then MS-FSSHTTP_R1701 can be covered.
                    Site.CaptureRequirementIfAreNotEqual<ErrorCodeType>(
                             ErrorCodeType.Success,
                             SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                             "MS-FSSHTTP",
                             1701,
                             @"[In MinorVersionNumberType][The value of MinorVersionNumberType] 0: In responses, indicates that the protocol server is not capable of managing the editors table and expects the protocol client to do so through PutChanges requests.");
                }
                else
                {
                    Site.Assert.AreNotEqual<ErrorCodeType>(
                        ErrorCodeType.Success,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                        @"[In MinorVersionNumberType][The value of MinorVersionNumberType] 0: In responses, indicates that the protocol server is not capable of managing the editors table and expects the protocol client to do so through PutChanges requests.");
                }
            }
            else
            {
                Site.Assume.Inconclusive(string.Format("This test case is only valuable when the MinorVersion value is 0, but the actual MinorVersion is {0}", cellStoreageResponse.ResponseVersion.MinorVersion));
            }
        }