public void A030_ResetKeyValue()
        {
            keySequenceService.ResetKeyValue(testingTableName, newKeyValue);

            string keyValue = keySequenceService.GetNextKey(testingTableName, keyPrefix);

            Assert.AreEqual(expectedExistingValueAfterReset, keyValue);
        }
Example #2
0
        /// <summary>
        /// Looks up the highest key in the table and set the last key in the key sequence table to
        /// that value for the table.
        /// </summary>
        public virtual void ResetKey()
        {
            string maxKey = repository.GetMaxKey();

            int maxKeyValue = 0;

            if (!String.IsNullOrWhiteSpace(maxKey))
            {
                maxKeyValue = int.Parse(maxKey.Substring(primaryKeyPrefix.Length));
            }

            keySequenceService.ResetKeyValue(repository.tableName, maxKeyValue);
        }