internal static void VerifyPaging(SmartObjectClientServerWrapper clientServer, SmartObject smartObject, int pageSize)
        {
            var totalDataTable = SmartObjectHelper.ExecuteListDataTable(clientServer, smartObject);

            AssertHelper.IsTrue(totalDataTable.Rows.Count > 0);

            for (int pageNumber = 1; totalDataTable.GetCondition(pageNumber, pageSize); pageNumber++)
            {
                var options = new ExecuteListReaderOptions
                {
                    PageNumber = pageNumber,
                    PageSize   = pageSize,
                    IncludeTotalRecordCount = (pageNumber % 2) == 1
                };

                var pagedReader = SmartObjectHelper.ExecuteListReader(clientServer, smartObject, options);
                if (options.IncludeTotalRecordCount)
                {
                    AssertHelper.AreEqual(totalDataTable.Rows.Count, pagedReader.TotalRecordCount);
                }
                else
                {
                    AssertHelper.AreEqual(-1, pagedReader.TotalRecordCount);
                }

                using (var pagedResults = new DataTable())
                {
                    pagedResults.Load(pagedReader);

                    SmartObjectHelper.CompareDataTables(totalDataTable.GetPagedResult(pageNumber, pageSize),
                                                        pagedResults);
                }
            }
        }
        public static void VerifyAllReturnPropertiesHasValues(SmartObject smartObject)
        {
            smartObject.ThrowIfNull("smartObject");

            var method = smartObject.GetMethod(smartObject.MethodToExecute);

            SmartObjectHelper.VerifyAllReturnPropertiesHasValues(method);
        }
        public static void PublishSmartObjects(SmartObjectDefinitionsPublish smartObjectDefinitionsPublish)
        {
            smartObjectDefinitionsPublish.ThrowIfNull("smartObjectDefinitionsPublish");

            var managementServer = WrapperFactory.Instance.GetSmartObjectManagementServerWrapper(null);

            using (managementServer.BaseAPIServer?.Connection)
            {
                // Delete SmartObjects
                foreach (SmartObjectDefinition smartObject in smartObjectDefinitionsPublish.SmartObjects)
                {
                    SmartObjectHelper.DeleteSmartObject(managementServer, smartObject.Name);
                }

                managementServer.PublishSmartObjects(smartObjectDefinitionsPublish.ToPublishXml());
            }
        }