public void MSLISTSWS_S02_TC30_GetListContentType_UseListTitleAsListName()
{
#region Invoke AddList to create a generic list.
string listGUID = TestSuiteHelper.CreateList();
#endregion
#region Invoke CreateContentType operation to create new content type for the new generic list.
string contentTypeId = null;
string fieldNameA = Common.GetConfigurationPropertyValue("ListFieldText", this.Site);
string contentTypeDisplayName = TestSuiteHelper.GetUniqueContentTypeName();
contentTypeId = TestSuiteHelper.CreateContentType(listGUID, contentTypeDisplayName, new List<string> { fieldNameA });
Site.Assert.IsNotNull(contentTypeId, "Error: Failed to create a new content type by CreateContentType operation!");
#endregion
#region Invoke GetList operation to get the title of the new generic list.
ListDefinitionSchema listDef = TestSuiteHelper.GetListDefinition(listGUID);
Site.Assert.IsNotNull(listDef, "Error: the object \"listDef\" is null !");
Site.Assert.IsNotNull(listDef.Title, "Error: the object \"listDef.Title\" is null !");
string listTitle = listDef.Title;
#endregion
#region Invoke GetListContentType operation with the new content type in the generic list, set the value of listName as the title of the list.
GetListContentTypeResponseGetListContentTypeResult getListContentTypeResult = null;
getListContentTypeResult = this.listswsAdapter.GetListContentType(listTitle, contentTypeId);
// Verify requirement R5861.
// If getting content type is successful, it means implementation does support this GetListContentType method. R5861 can be captured.
if (Common.IsRequirementEnabled(5861, this.Site))
{
Site.CaptureRequirementIfIsNotNull(
getListContentTypeResult,
5861,
@"Implementation does support this method[GetListContentType]. (Windows SharePoint Services 3.0 and above follow this behavior.)");
}
// If we get the successful response of GetListContentType, we can capture R592 and R593.
bool isR592Verified = false;
bool isR593Verified = false;
if (getListContentTypeResult != null)
{
isR592Verified = true;
isR593Verified = true;
}
#endregion
#region Capture requirements #592 and #593 when we get the successful response of GetListContentType.
Site.CaptureRequirementIfIsTrue(
isR592Verified,
592,
@"[In GetListContentType operation] If the specified listName is not a valid GUID, check if the listName corresponds to the list title of a list on the site and if so, use that list.");
Site.CaptureRequirementIfIsTrue(
isR593Verified,
593,
@"[In GetListContentType operation] If the specified listName does not correspond to the identification of a list on the site, check if the listName corresponds to the list title of a list on the site and if so, use that list.");
#endregion
}