public void MSCPSWS_S05_TC04_SearchAll_nullSearchPattern()
{
// Get the provider names of all the providers from the hierarchy
ArrayOfString providerNames = new ArrayOfString();
SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
{
this.DepthFirstTraverse(node, ref providerNames);
}
// Set search principal Type.
SPPrincipalType principalType = SPPrincipalType.SharePointGroup;
// Get max count of matched entities allowed to return for this search.
int maxCount = Convert.ToInt32(Common.GetConfigurationPropertyValue("MaxCount", Site));
bool caughtException = false;
try
{
// Set searchPattern as null and call searchAll.
CPSWSAdapter.SearchAll(providerNames, principalType, null, maxCount);
}
catch (System.ServiceModel.FaultException faultException)
{
caughtException = true;
// Verify Requirement 650, if the server returns an ArgumentNullException<"searchPattern"> message.
Site.CaptureRequirementIfIsTrue(this.VerifyArgumentNullException(faultException, "searchPattern"), 650, @"[In SearchAll] If this [searchPattern] is NULL, the protocol server MUST return an ArgumentNullException<""searchPattern""> message.");
}
finally
{
this.Site.Assert.IsTrue(caughtException, "If searchPattern is NULL, the protocol server MUST return an ArgumentNullException<searchPattern> message.");
}
}
#endregion