public void PackageTemplateBase_TableColumnProcessing_AutonumberSeedIsSet(string entityName, string attributeName, int expectedValue)
        {
            var req = new GetAutoNumberSeedRequest
            {
                EntityName    = entityName,
                AttributeName = attributeName,
            };

            GetAutoNumberSeedResponse response = (GetAutoNumberSeedResponse)this.fixture.ServiceClient.Execute(req);

            response.AutoNumberSeedValue.Should().Be(expectedValue);
        }
示例#2
0
        /// <summary>
        /// Checks if the Auto-number seed value is already set to the desired value. If so, we do not want to set the value as it will reset the next number in the sequence to the seed value.
        /// </summary>
        /// <returns>Boolean indicating if the seed value is already set in the target environment.</returns>
        private bool AutonumberSeedAlreadySet(string tableName, ColumnConfig columnConfig)
        {
            GetAutoNumberSeedRequest request = new GetAutoNumberSeedRequest
            {
                EntityName    = tableName,
                AttributeName = columnConfig.Name,
            };

            GetAutoNumberSeedResponse response = (GetAutoNumberSeedResponse)this.crmSvc.Execute(request);

            if (response != null && response.AutoNumberSeedValue == columnConfig.AutonumberSeedValue)
            {
                this.logger.LogInformation($"Auto-number seed {columnConfig.Name} for {tableName} is already set to value: {columnConfig.AutonumberSeedValue}");
                return(true);
            }
            else
            {
                return(false);
            }
        }