public void TestCase_S07_TC02_EditorsTable_LeaveEditSession()
{
if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 9001, this.Site))
{
Site.Assume.Inconclusive("Implementation does not support the editors table.");
}
// Initialize the service
this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);
// User01 to join the editor table session
this.PrepareJoinEditorsTable(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID);
// User02 to join the editor table session
this.InitializeContext(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain);
this.PrepareJoinEditorsTable(this.DefaultFileUrl, System.Guid.NewGuid().ToString(), this.UserName02, this.Password02, this.Domain);
// User01 leaves the editors table session.
// Initialize the service
this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);
EditorsTableSubRequestType leaveEditorsTable = SharedTestSuiteHelper.CreateEditorsTableSubRequestForLeaveSession(SharedTestSuiteHelper.DefaultClientID);
CellStorageResponse cellStorageResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { leaveEditorsTable });
EditorsTableSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse<EditorsTableSubResponseType>(cellStorageResponse, 0, 0, this.Site);
this.Site.Assert.AreEqual<ErrorCodeType>(
ErrorCodeType.Success,
SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
"The user {0} should leave the editors table on the file {1} succeed.",
this.UserName01,
this.DefaultFileUrl);
// Fetch the editors table
EditorsTable editorsTable = this.FetchEditorTable(this.DefaultFileUrl);
Editor firstEditor = this.FindEditorById(editorsTable, SharedTestSuiteHelper.DefaultClientID);
this.Site.Assert.IsNull(
firstEditor,
"For requirement MS-FSSHTTP_R1987 and MS-FSSHTTP_R1997, When the user {0} with the client id {1} leaves the editors table, the client id should not exist in the editors tables in the server.",
this.UserName01,
SharedTestSuiteHelper.DefaultClientID);
if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
{
// If the above asserts are valid, then MS-FSSHTTP_R1987, MS-FSSHTTP_R1997 can be captured.
Site.CaptureRequirement(
"MS-FSSHTTP",
1987,
@"[In Leave Editing Session] The protocol server processes this request[the EditorsTableRequestType attribute is set to ""LeaveEditingSession""] to remove the entry in the editors table associated with the coauthorable file corresponding to the client with the given ClientId.");
// Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1997
Site.CaptureRequirement(
"MS-FSSHTTP",
1997,
@"[In Remove Editor Metadata] The protocol server processes this request[Remove Editor Metadata] to remove the client-supplied key/value pair for the given key in the entry in the editors table associated with the coauthorable file corresponding to the client with the given ClientId.");
}
}