public bool UndoCheckOutFileByUser(string fileUrl, string userName, string password, string domain)
{
#region parameter validation
FileUrlHelper.ValidateFileUrl(fileUrl);
if (string.IsNullOrEmpty(userName))
{
throw new ArgumentNullException("userName");
}
#endregion parameter validation
if (null == this.listswsProxy)
{
throw new InvalidOperationException("The LISTSWS proxy is not initialized, should call the [Initialize] method before calling this method.");
}
this.listswsProxy.Credentials = new NetworkCredential(userName, password, domain);
bool undoCheckOutResult;
try
{
undoCheckOutResult = this.listswsProxy.UndoCheckOut(fileUrl);
}
catch (SoapException soapEx)
{
this.Site.Log.Add(
LogEntryKind.Debug,
@"There is an exception generated when the SUT control adapter try to undo check out for a file[{0}]:\r\nExcetption Message:\r\n[{1}]\r\\nStackTrace:\r\n[{2}]",
fileUrl,
string.IsNullOrEmpty(soapEx.Message) ? "None" : soapEx.Message,
string.IsNullOrEmpty(soapEx.StackTrace) ? "None" : soapEx.StackTrace);
return false;
}
finally
{
this.listswsProxy.Credentials = TestSuiteManageHelper.DefaultUserCredential;
}
return undoCheckOutResult;
}