Microsoft.Protocols.TestSuites.MS_VIEWSS.MS_VIEWSSSUTControlAdapter.GetListAndView C# (CSharp) Method

GetListAndView() public method

A method retrieves default view.
public GetListAndView ( string listDisplayName ) : string
listDisplayName string A specified list name in the server.
return string
        public string GetListAndView(string listDisplayName)
        {
            string originalDefaultViewName = null;
            GetListAndViewResponseGetListAndViewResult result = null;
            try
            {
                result = this.listProxy.GetListAndView(listDisplayName, string.Empty);
            }
            catch (SoapException soapEx)
            {
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"There is an exception generated when calling [GetListAndView] method:\r\n{0}, check the parameter is correct or not.",
                    soapEx.Message);

                throw;
            }

            Site.Assert.IsNotNull(result, "If the GetListAndView operation executes successfully, the response should not be null.");
            if (result.ListAndView != null)
            {
                if (result.ListAndView.View != null)
                {
                    Site.Assert.AreEqual<string>(
                        "true", 
                        result.ListAndView.View.DefaultView.ToLower(), 
                        @"The view returned in server response should be default view of the specified list as the 'viewName' was set to empty.");

                    originalDefaultViewName = result.ListAndView.View.Name;
                }
            }

            return originalDefaultViewName;
        }
        #endregion